本文介绍了Windows Phone 文字转语音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用从 codeplex 获得的 WP 语音库,现在代码很好,没有错误,但是没有语音输出!!
i am trying to use a WP speech library i got from codeplex, now the code is fine with no errors, but there are no voice output!!
using wpSpeech;
namespace TalkForMe
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
SpeechTTS spk;
spk = new SpeechTTS ( textBox1.Text);
spk.SpeakLanguage = "en";
spk.SpeakText(textBox1.Text);
}
}
}
推荐答案
您的代码有一个很小的错误.您为 SpeakTTS 创建了一个引用,但没有为其分配任何内存.像这样尝试并尝试.
Your code has a very small mistake. You created a reference for SpeakTTS but didn't allocate any memory for it. try like this and try.
SpeechTTS spk=new SpeakTTS();
这篇关于Windows Phone 文字转语音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!