c# - voice command to capture photo -


i use windows.media.capture.mediacapture in windows phone 8.1 app capture photo. instead of button, i'd trigger photo capturing process voice command (for example, if user says 'cheese'). how can detect such voice command?

you can use speechrecognizer class.

here's sample msdn:

private async void startrecognizing_click(object sender, routedeventargs e) {     // create instance of speechrecognizer.     var speechrecognizer = new windows.media.speechrecognition.speechrecognizer();      // compile dictation grammar default.     await speechrecognizer.compileconstraintsasync();      // start recognition.     windows.media.speechrecognition.speechrecognitionresult speechrecognitionresult = await speechrecognizer.recognizewithuiasync();      // recognition result.     var messagedialog = new windows.ui.popups.messagedialog(speechrecognitionresult.text, "text spoken");     await messagedialog.showasync(); } 

Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -