Click here to Skip to main content
Click here to Skip to main content

SpeechRecognition Windows Phone 8 c#

, 6 Aug 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
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 ! Wink | ;)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Anis Derbel
Software Developer (Junior) Microsoft Student Partners
Tunisia Tunisia
I study Software Engineering , 23 years old , I'm motivated with all Technologies of Microsoft.
Since I have been in the Community of Microsoft as Microsoft Student Partners, I developped many apps on the platform Windows and Phone. Now , it's time to share what I learn here and I'am ready to help Everyone.
You can contact me at any time (anisderbel@outlook.com)
Group type: Organisation

9 members

Follow on   LinkedIn

Comments and Discussions

 
SuggestionSome improvements PinmentorMika Wendelius6-Aug-14 20:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.141223.1 | Last Updated 7 Aug 2014
Article Copyright 2014 by Anis Derbel
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid