c# - Exception HRESULT: 0x800455BC in speech recognition in Windows phone 8 -
i developing new app using speech recognition capability windows phone 8. however, getting following exception:
exception hresult: 0x800455bc
at system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ system.runtime.compilerservices.taskawaiter`1.getresult() @ excercisemod7voice.mainpage.d__4.movenext()
and code i'm trying use:
private async void btnspeak_click(object sender, routedeventargs e) { var recognizer = new speechrecognizerui(); recognizer.settings.showconfirmation = true; recognizer.settings.readoutenabled = false; try { var result = await recognizer.recognizewithuiasync(); if (result.resultstatus == speechrecognitionuistatus.succeeded) { messagebox.show(result.recognitionresult.text); } } catch (exception ex) { messagebox.show(ex.message); } }
when run app , click in button speak displays message confirmation few seconds , disappears.
note: i'm testing directly cellphone app. (nokia lumia 920)
that error message means language isn't supported. i'm not sure language settings can recognizer locale using (swap en-gb
culture want)
var localrec = installedspeechrecognizers.all .where(r => r.language == "en-gb").firstordefault();
then set recognizer language
if(localrec != null) recognizer.recognizer.setrecognizer(localrec); else messagebox.show("recognizer language not found");
if don't explicitly set locale above system use language set in phone's speech
settings.
Comments
Post a Comment