static void Main(string[] args) { using (FileStream fs = new FileStream(@"E:\sample.wav", FileMode.Open)) { using (BinaryReader reader = new BinaryReader(fs)) { byte[] datas = reader.ReadBytes((int)fs.Length); // Replace "xxxxxxxx" below with your project's access_key and access_secret. string result = IdentifyProtocolV2.recognize("ap-southeast-1.api.acrcloud.com", "xxxxxxxx", "xxxxxxxx", datas, "audio"); Console.WriteLine(result); } } Console.ReadLine(); }
static void Main(string[] args) { using (FileStream fs = new FileStream(@"E:\sample.wav", FileMode.Open)) { using (BinaryReader reader = new BinaryReader(fs)) { byte[] datas = reader.ReadBytes((int)fs.Length); // Replace "###...###" below with your project's host, access_key and access_secret. string result = IdentifyProtocolV2.recognize("###YOUR_HOST", "###YOU_ACCESS_KEY###", "###YOUR_ACCESS_SECRET###", datas, "audio"); Console.WriteLine(result); } } Console.ReadLine(); }