15. .NETラボ 勉強会 2016年4月
音声会話
?音声認識
15
this.Speech =
new SpeechRecognizer
(SpeechRecognizer.SystemSpeechLanguage);
var dictationConstraint =
new SpeechRecognitionTopicConstraint
(SpeechRecognitionScenario.Dictation,
"dictation");
this.Speech.Constraints.Add(dictationConstraint);
SpeechRecognitionCompilationResult result =
await this.Speech.CompileConstraintsAsync();
this.Speech.ContinuousRecognitionSession.ResultGenerated
+= ContinuousRecognitionSession_ResultGenerated;
16. .NETラボ 勉強会 2016年4月
音声会話
?EV3制御+雑談
? https://api.apigw.smt.docomo.ne.jp/
16
var client = new HttpClient();
var respon = await client.PostAsync(requestUri,
new StringContent(json,
System.Text.Encoding.UTF8,
"application/json"));
var responJsonText =
await respon.Content.ReadAsStringAsync();
var ans =
JsonConvert.DeserializeObject<TAnswer>(responJsonTex
this.AnswerText = ans.utt;
17. .NETラボ 勉強会 2016年4月
音声会話
?音声合成 (Win10標準)
17
var synthesizer =
new Windows.Media.SpeechSynthesis.SpeechSynthesizer();
var stream =
await synthesizer.SynthesizeTextToStreamAsync(message);
this.Element.SetSource(stream, stream.ContentType);
this.Element.Play();