问题
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);
}
}
}
回答1:
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();
来源:https://stackoverflow.com/questions/15720658/windows-phone-text-to-speech