Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

SpeechRecognition Windows Phone 8 c#

0.00/5 (No votes)
6 Aug 2014 1  
The easy way to use speech Recognition by converting Speech to Text

Introduction

Sometimes , we don't want to type some words by keyboard in the App , if you got tired and you want just speech so here is the solution.

Using the code

First of all , you need to add the Capability ID_CAP_SPEECH_RECOGNITION on the Manifest file.

we create an instance of  SpeechRecognitionResult.

 SpeechRecognitionResult recoResult = await myRecognizer.RecognizeAsync();

The speech will be Translated by bing. if it recognise what you said as the correct language it will return it as a Text else it will return an erreur.

            try
            
              {
               
               

                // Check to see if speech input was rejected and prompt the user.
                if (recoResult.TextConfidence == SpeechRecognitionConfidence.Rejected)
                {
                   test  = "Sorry, didn't catch that. \n\nSay again.";
                 
                }

                // Check to see if speech input was recognized with low confidence and prompt the                 // user to speak again.
                else if (recoResult.TextConfidence == SpeechRecognitionConfidence.Low)
                {
                    test  = "Not sure what you said. \n\nSay again.";

                }

                // Check to see if speech input was recognized and confirm the result.
                else if (recoResult.TextConfidence == SpeechRecognitionConfidence.High ||
                      recoResult.TextConfidence == SpeechRecognitionConfidence.Medium)
                {

                        MessageBox.Show(recoResult.Text);
                }
              
            }
            catch (Exception ee)
            {

               //erreur
            }

 

You just implement this code , you should change the language on the Settings on you device.

History

You can know create many usefull Apps , what are you waiting for ! ;)

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here