你好,游客 登录 注册 搜索
背景:
阅读新闻

Windows Phone 8 语音 - Speech for Windows Phone 8

[日期:2013-08-18] 来源:Linux社区  作者:王博_Nick [字体:大 中 小]

3. 文字语音 text-to-speech (TTS) 对应 ID_CAP_SPEECH_RECOGNITION capability in the app manifest

最后 TTS 大家很容易理解的 就是把文字转换成声音念出来很简单

 

 
private async void ButtonSimpleTTS_Click(object sender, RoutedEventArgs e)
{
SpeechSynthesizer synth = new SpeechSynthesizer();

await synth.SpeakTextAsync("You have a meeting with Peter in 15 minutes.");
}
 

当然也同样支持语言的选择

 
// Declare the SpeechSynthesizer object at the class level.
SpeechSynthesizer synth;

// Handle the button click event.
private async void SpeakFrench_Click_1(object sender, RoutedEventArgs e)
{
// Initialize the SpeechSynthesizer object.
synth = new SpeechSynthesizer();

// Query for a voice that speaks French.
IEnumerable<VoiceInformation> frenchVoices = from voice in InstalledVoices.All
where voice.Language == "fr-FR"
select voice;

// Set the voice as identified by the query.
synth.SetVoice(frenchVoices.ElementAt(0));

// Count in French.
await synth.SpeakTextAsync("un, deux, trois, quatre");
}
 

这里我就是直接粘贴的MSDN代码 真的很简单就不废话了

连接给出 : http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207057(v=vs.105).aspx

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款