Windows Phone Text to speech

二次信任 提交于 2019-12-12 00:34:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!