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

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

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