Universal Windows App Development with Cortana and the Speech SDK 4
来源:互联网 发布:数据库三范式概念 编辑:程序博客网 时间:2024/05/09 01:56
4 Speech Recognition in Apps
4.1 Understanding In-App Speech Recognition
4.1.1 Speech Privacy Statement
User must accept the Privacy Statement
catch (Exception exception){const uint HResultPrivacyStatementDeclined=0x80045509;if ((uint)exception.HResult == HResultPrivacyStatementDeclined){var messageDialog=new Windows.UI.Popups.MessageDialog("You must accept the speech privacy policy to continue.", "Speecg Exception");messageDialog.ShowAsync().GetResults();this.recoEnabled=false;this.btnContinousRecognition.Content= "Start speech recognition";}else{txtResult.Text=exception.Message;}}
4.1.2 Speech Recognition Constraints
Pre-defined grammars
Custom Grammars (can work offline)
PhraseList
4.1.3 In Application Basic Speech Recognition
//windows phone store appprivate async Task<SpeechRecognitionResult> RecognizeSpeech(){SpeechRecognizer recognizer=new SpeechRecognizer();// one of three constraints types availableSpeechRecognitionTopicConstraint topicConstraint =new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario.WebSearch,"MSDN");recongnizer.Constraints.Add(topicConstraint);await recognizer.ComplieConstarintAsync();// required//put up UI and recognize user's utteranceSpeechRecognitionResult result= await recognizer.RecognizeWithUIAsync();return result;}//calling code uses result.RecognitionResult.Text or result.RecognitionResult.SemanticInterpretation
create the constraint (type, constraint name)
add it to the recognizer
compile the constraint
private async void RecognizeWithDictationGrammar_Click(object sender, RoutedEventArgs e){// Create an instance of SpeechRecognizer.var speechRecognizer = new Windows.Media.SpeechRecognition.SpeechRecognizer();// Compile the dictation grammar that is loaded by default.await speechRecognizer.CompileConstraintsAsync();this.heardYouSayTextBlock.Visibility = this.resultTextBlock.Visibility = Visibility.Collapsed;// Start recognition.try{Windows.Media.SpeechRecognition.SpeechRecognitionResult speechRecognitionResult = await speechRecognizer.RecognizeWithUIAsync();// If successful, display the recognition result.if (speechRecognitionResult.Status == Windows.Media.SpeechRecognition.SpeechRecognitionResultStatus.Success){this.heardYouSayTextBlock.Visibility = this.resultTextBlock.Visibility = Visibility.Visible;this.resultTextBlock.Text = speechRecognitionResult.Text;}}catch (Exception exception){if ((uint)exception.HResult == App.HResultPrivacyStatementDeclined){this.resultTextBlock.Visibility = Visibility.Visible;this.resultTextBlock.Text = "The privacy statement was declined.";}else{var messageDialog = new Windows.UI.Popups.MessageDialog(exception.Message, "Exception");messageDialog.ShowAsync().GetResults();}}}private async void Footer_Click(object sender, RoutedEventArgs e){await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));}}}
4.2 Programmatic List Grammars
Also as phrase list grammars
Deal with recognition confidence
4.3 Custom SRGS Grammars
SRGS (Speech Recognition Grammar Specification)
W3C stanrdar that allows you to create grammars for speech recognition scenarios ranging from basic to complex
- http://www.w3.org/TR/speech-grammar
Ideal for advanced speech recognition scenarios
Allow for complex combos across several rules
4.4 Optimizing Speech Recognition
Using multiple grammars
Tuning Timeouts
Managing Audio Input Issues : RecognitionQualityDegrade
4.5 Speech Recognition and Globalization
4.6 Speech Recognition Comparison Across Platforms
0 0
- Universal Windows App Development with Cortana and the Speech SDK 4
- Universal Windows App Development with Cortana and the Speech SDK 1 and 2 @Channel9
- Universal Windows App Development with Cortana and the Speech SDK 3
- Universal Windows App Development with Cortana and the Speech SDK 5
- Universal Windows App Development with Cortana and the Speech SDK 6
- Preparing and Submitting an Application to the App Store with xCode4.2 and iOS5 SDK
- Link - Windows Universal App - Open Url/Rate the App/MessageDialog
- Beginning iPhone Development with Swift Exploring the iOS SDK 源代码
- Mobile Application Development with SMS and the SIM Toolkit
- Game Development with JavaScript and the Canvas element
- Universal Windows App
- Professional WCF Programming: .NET Development with the Windows Communication Foundation
- Professional WPF Programming: .NET Development with the Windows Presentation Foundation
- Speech SDK 5.1 for Windows® applications
- 微软Windows Speech SDK编程入门
- Link - Windows Universal App - AppBar
- Beginning iPhone Development with Swift: Exploring the iOS SDK电子书&源代码
- Along with the social development
- Qt坑: connectToServer: Connection refused.
- 简单易用的Div弹出层
- UCenter+云市场?开源用户中心2.0时代即将开启
- Mat转换成IplImage类型
- 什么是电脑超频?
- Universal Windows App Development with Cortana and the Speech SDK 4
- java.util.concurrent介绍
- delphi如何实现无窗口移动
- iptables的详细介绍及配置方法
- VMWARE Fusion 5 and Cent 6.4
- Fusion 360 API 在线研讨会 (英文)- 2015年3月25日晚12:00
- Linux 的 initrd (linuxrc,init)
- Android中ViewFlipper的使用详解
- BroadcastReceive广播接收器: