none
Microsoft Speech and speech recognition RRS feed

  • Question

  • Hi

    I am trying to create simple app to recognize some words in polsh. I have polish windows 10 and ms speach librarys installed. I dont know to use Microsoft.Speech or System.Speech. Neither code work.

    1:

            static void Main(string[] args)
            {
    
                // Create a new SpeechRecognitionEngine instance.
                SpeechRecognitionEngine sre = new SpeechRecognitionEngine();
    
                // Configure the input to the recognizer.
                sre.SetInputToWaveFile(@"c:\Test\Colors.wav");
    
                // Create a simple grammar that recognizes "red", "green", or "blue".
                Choices colors = new Choices();
                colors.Add(new string[] { "Czerwony", "zielony", "niebieski" });
    
                // Create a GrammarBuilder object and append the Choices object.
                GrammarBuilder gb = new GrammarBuilder();
                gb.Append(colors);
    
                // Create the Grammar instance and load it into the speech recognition engine.
                Grammar g = new Grammar(gb);
                sre.LoadGrammar(g);
    
                // Register a handler for the SpeechRecognized event.
                sre.SpeechRecognized +=
                  new EventHandler<SpeechRecognizedEventArgs>(sre_SpeechRecognized);
    
                // Start recognition.
                sre.Recognize();
    
            }
            static void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
            {
                Console.WriteLine("Speech recognized: " + e.Result.Text);
            }

    Exception: Additional information: Speech Recognition is not available on this system. SAPI and Speech Recognition engines cannot be found.

    2.

            static void Main(string[] args)
            {
    
                // Create a new SpeechRecognitionEngine instance.
                SpeechRecognizer recognizer = new SpeechRecognizer();
    
                // Create a simple grammar that recognizes "red", "green", or "blue".
                Choices colors = new Choices();
                colors.Add(new string[] { "czerwony", "zielony", "niebieski" });
    
                // Create a GrammarBuilder object and append the Choices object.
                GrammarBuilder gb = new GrammarBuilder();
                gb.Append(colors);
    
                // Create the Grammar instance and load it into the speech recognition engine.
                Grammar g = new Grammar(gb);
                recognizer.LoadGrammar(g);
    
                // Register a handler for the SpeechRecognized event.
                recognizer.SpeechRecognized +=
                  new EventHandler<SpeechRecognizedEventArgs>(sre_SpeechRecognized);
    
            }
            static void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
            {
                Console.WriteLine("Speech recognized: " + e.Result.Text);
            }

    Exeption: Additional information: Nie zainstalowano żadnego aparatu rozpoznawania.

    in english: recognizer not found

    Friday, March 25, 2016 10:44 AM

All replies

  • Hi CapitanPlanet,

    >> I have polish windows 10 and ms speach librarys installed. I dont know to use Microsoft.Speech or System.Speech. Neither code work.

    To better know which one you should used. I think you should know the difference between Microsoft.Speech and System.Speech.

    The short answer is that Microsoft.Speech.Recognition uses the Server version of SAPI, while System.Speech.Recognition uses the Desktop version of SAPI.

    For more details, please refer to What is the difference between System.Speech.Recognition and Microsoft.Speech.Recognition?

    Based on your scenario, I think using System.Speech will be better.

    >>Exception: Additional information: Speech Recognition is not available on this system. SAPI and Speech Recognition engines cannot be found.

    So let's focus on your above error, Before you attempt using the Speech Recognizer service

    please make sure your speech recognition engine is installed and make sure that it is properly configured and working by using the Help or user documentation that is provided for it.

    Or build to project to a specific version(x86 or x64).

    Basically there is a thread that talking about this issue, please take a look.

    Speech Recognition is not available on this system. SAPI and Speech Recognition engines cannot be found

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 28, 2016 2:13 AM