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

android - questions about switching from C2DM to GCM -

c++ - Qt setGeometry: Unable to set geometry -

batch file - How to extract all multi-volume RAR archives from subfolders of a folder? -