I have below code for speech recognition
When i execute it on emulator it works fine. But when i execute it on device. After executing last line it throws exception with below details.Code:// Initialize the SpeechRecognizerUI object. SpeechRecognizerUI recoWithUI = new SpeechRecognizerUI(); // Display text to prompt the user's input. recoWithUI.Settings.ListenText = "one plus two?"; // Give an example of ideal speech input. recoWithUI.Settings.ExampleText = "'One Plus Two', 'Calculate Fourty Divide Two', 'Fifty Six Multiply by Three'"; // Initialize a URI with a path to the SRGS-compliant XML file. Uri calculatorRulesUri = new Uri("file://" + Windows.ApplicationModel.Package.Current.InstalledLocation.Path + @"/CalculatorRules.xml", UriKind.RelativeOrAbsolute); // Add the grammar to the grammar set. recoWithUI.Recognizer.Grammars.AddGrammarFromUri("calculatorRulesUri", calculatorRulesUri); // Load the grammar set and start recognition. SpeechRecognitionUIResult recoResult = await recoWithUI.RecognizeWithUIAsync();
Message = "Exception from HRESULT: 0x800455B1"
StackTrace = " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n ...
What could be the issue. I have English(India) speech language installed on my phone.
Regards,
Vinay

Reply With Quote


