예제 #1
0
        private static void SpeechToTextRest()
        {
            //Recognition mode:1.interactive 2.conversation 3.dictation
            //Language :en-US
            //Output format :1.Default 2. Detailed 3.Simple
            var srService = new SpeechToTextService("interactive", "en-IN", "Simple");

            srService.SendAudio(Constants.AUDIO_DIRECTORY + "speechToText12.wav");
        }
예제 #2
0
 private static void SpeechToText()
 {
     try
     {
         // Create the service
         Console.WriteLine("Creating the Speech to Text Service.");
         var srService = new SpeechToTextService(SpeechRecognitionMode.ShortPhrase, "en-us", Constants.Speech_API_Key);
         Console.WriteLine("Done");
         Console.WriteLine("");
         srService.SendAudio(Constants.AUDIO_DIRECTORY + "speechToText1.wav");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error: " + ex.Message);
         throw;
     }
     Console.ReadKey();
 }