locked
[WPSL]How to develop the Speech Recognition(Speech to Text) in Windows phone 8. RRS feed

  • Question

  • Dear Sir/Mam,

    Please give me help for develop the Speach Recognition(Speach to Text) in Windows phone 8.

    I completed Text to Speach in wp8 successfully, but i can't do Speach to Text in wp8. It throws one exception that "The text associated with this error code could not be found". 

       public async void SpeechToText_Click(object sender, RoutedEventArgs e)
            {
                //Part 1 - Basic Demo
                SpeechRecognizerUI speechRecognition = new SpeechRecognizerUI(); // ---------->Error came here.
                SpeechRecognitionUIResult recoResult = await speechRecognition.RecognizeWithUIAsync();
    
                if (recoResult.ResultStatus == SpeechRecognitionUIStatus.Succeeded)
                {
                    MessageBox.Show(string.Format("You said {0}.", recoResult.RecognitionResult.Text));
                }
         }

    Please give solution.

    Thanks & Regards,

    SrinivaaS.


    Monday, April 27, 2015 1:00 PM

Answers

  • Go to Settings->Speech on your device & select English(United States), implying you need to select the speech which is already installed on your device (probably there's some other speech language selected in the speech settings which needs to be downloaded first)

    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

    Friday, May 8, 2015 10:12 AM

All replies

  • Hi,

    Please help me any one,it is not working in WP8 Device. I am using this sample code in Emulator it shows VoiceCommandListerner but it not catch that voice. If i used that app in WP8 device then it shows an error that "The text associated with this error code could not be found".

    Please help me any one.

    Thanks & Regards,

    SrinivaaS.

    Tuesday, April 28, 2015 7:43 AM
  • To use speech recognition, you must set the ID_CAP_SPEECH_RECOGNITION, ID_CAP_MICROPHONE, and ID_CAP_NETWORKING capabilities in the app manifest. If you do not set these capabilities, your app might not work correctly. For more info, see App capabilities and hardware requirements for Windows Phone 8.

    I sale myself ONLY half CNY!

    Tuesday, April 28, 2015 1:43 PM
  • Hi  accado liao ,

    Thank you for your reply,

    I was set all these Capabilities, but it doesn't work perfectly,it shows an error like above error.

    Thanks & Regards,

    SrinivaaS.

    Wednesday, May 6, 2015 5:07 AM
  • What is the error raised? We cannot help you if you don't provide full information.
    Wednesday, May 6, 2015 5:41 AM
  • Dear Sir/Mam,

    Please give me help for develop the Speach Recognition(Speach to Text) in Windows phone 8.

    I completed Text to Speach in wp8 successfully, but i can't do Speach to Text in wp8. It throws one exception that "The text associated with this error code could not be found". 

       public async void SpeechToText_Click(object sender, RoutedEventArgs e)
            {
                //Part 1 - Basic Demo
                SpeechRecognizerUI speechRecognition = new SpeechRecognizerUI(); // ---------->Error came here.
                SpeechRecognitionUIResult recoResult = await speechRecognition.RecognizeWithUIAsync();
    
                if (recoResult.ResultStatus == SpeechRecognitionUIStatus.Succeeded)
                {
                    MessageBox.Show(string.Format("You said {0}.", recoResult.RecognitionResult.Text));
                }
         }

    Please give solution.

    Thanks & Regards,

    SrinivaaS.


         Hi Rob Caplan,

         Thanks for your reply,

         Exception :- An exception of type 'System.InvalidOperationException' occurred in                                Microsoft.Phone.Maps.ni.dll but was not handled in user code

         Error Message :- "The text associated with this error code could not be found"

         

         



    Wednesday, May 6, 2015 7:43 AM
  • https://www.dropbox.com/s/iapdz4uvmj8p6ho/S13%20Using%20Speech.pdf?dl=0

    use this  document (at above link) to work with the speech in windows phone


    Ramakant Verma .NET Consultant(Windows Azure, Windows Phone8,Windows 8,ASP.NET,Silverlight)

    Wednesday, May 6, 2015 9:28 AM
  • Please don't quote entire messages. That makes the thread hard to read without adding any information. Quote only small sections that you are responding to can give context.

    Your original question says the exception is raised when instantiating a SpeechRecognizerUI object, but the exception you quote is in Microsoft.Phone.Maps. Can you confirm that's correct? What is the stack when the exception is raised?

    Can you reproduce this in a minimal project that you can share on your OneDrive?

    Wednesday, May 6, 2015 11:58 PM
  • Hi Rob Caplan,

    I was given full details, but you can't understand my problem. I am used above (Already i mentioned that button click event code) code.

     It is working fine in Emulator ,but it isn't  working fine in wp8 device(Nokia Lumia 520 model),

    It show an error and it goes to method  of App.cs file that

     
    private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
            {
                if (Debugger.IsAttached)
                {
                    // An unhandled exception has occurred; break into the debugger
                    Debugger.Break();
                }
            }

    Exception is that:- 

     at Windows.Phone.Speech.Recognition.SpeechRecognizerUI..ctor()
       at VSMagSR.MainPage.<SpeechToText_Click>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__0(Object state)

    Error Message :-The text associated with this error code could not be found.

    Exception box shows that  "

    An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in System.Windows.ni.dll

    "

    Thanks & Regards,

    SrinivaaS.

    Friday, May 8, 2015 9:43 AM
  • Hi Ramakant Programmer,

    I was followed your suggetions using with your Pdf file provided by your link that "https://www.dropbox.com/s/iapdz4uvmj8p6ho/S13%20Using%20Speech.pdf?dl=0"

     It is working fine in Emulator ,but it isn't  working fine in wp8 device(Nokia Lumia 520 model),

    It show an error and it goes to method  of App.cs file that

     
    private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
            {
                if (Debugger.IsAttached)
                {
                    // An unhandled exception has occurred; break into the debugger
                    Debugger.Break();
                }
            }

    Exception is that:- 

     at Windows.Phone.Speech.Recognition.SpeechRecognizerUI..ctor()
       at VSMagSR.MainPage.<SpeechToText_Click>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__0(Object state)

    Error Message :-The text associated with this error code could not be found.

    Exception box shows that  "

    An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in System.Windows.ni.dll

    "

    Thanks & Regards,

    SrinivaaS.

    Friday, May 8, 2015 9:46 AM
  • This kind of exception raised when something you try to access is not there . for example you try to access some service and that service is not available or down .

    can you please share the code .

    so that we can check the source of exception


    Ramakant Verma .NET Consultant(Windows Azure, Windows Phone8,Windows 8,ASP.NET,Silverlight)

    Friday, May 8, 2015 9:53 AM
  • Go to Settings->Speech on your device & select English(United States), implying you need to select the speech which is already installed on your device (probably there's some other speech language selected in the speech settings which needs to be downloaded first)

    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

    Friday, May 8, 2015 10:12 AM
  • I was given full details, but you can't understand my problem. I am used above (Already i mentioned that button click event code) code.

     It is working fine in Emulator ,but it isn't  working fine in wp8 device(Nokia Lumia 520 model),

    Hi SrinivaaS,

    Unfortunately you have not given sufficient information for anybody to do more than guess what is going on. Remember that we don't have the same context and understanding of what you are doing as you do: we only know what you've actually told us, and you've given different information in different posts and posted secondary information about the exception rather than the primary information (the UnhandledException handler isn't nearly as interesting as the original exception).

    As I said previously, if you need further help with this then please share a minimal sample which demonstrates the problem along with exact repro steps. If this only reproduces on the one machine then sharing the  crash dump would also be useful.

    Until you can provide more information nobody can do anything beyond guess.

    --Rob

    Friday, May 8, 2015 9:21 PM
  • Hi Rob,

    Already Vineeth understand my problem. How can he understand my problem. I was followed his suggetions in device side settings then it works fine. Thank you vineeth.

    Once again 

    Thanks & Regards,

    SrinivaaS.

    Wednesday, May 13, 2015 10:36 AM
  • He didn't understand the problem. He made a lucky guess.

    Based on the minimal information you provided there could have been many other causes.

    Wednesday, May 13, 2015 7:24 PM
  • Only tried creating a 'SpeechRecongnizerUI' object and faced the same exception, then searched & found that a probably cause may be the selection of incorrect(which is not downloaded yet on the device) speech language in the speech settings, thereby changing the speech language to English(US) which is already installed on device, made the code to work and considering the poster might be having the same case, i posted my suggestion.

    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8


    • Edited by Vineet24 Thursday, May 14, 2015 5:09 AM
    Thursday, May 14, 2015 5:09 AM
  • OK Vineeth24,

    It is speak in English(US) slang, I want Indian slang,How can i do for this. am i download English(India) Language package.

    Any way thanks for your help.

    Thanks & Regards,

    SrinivaaS.

    Thursday, May 14, 2015 6:09 AM