我正在运行Hello World的样本
我的代码是

private async void Button_Click(object sender, RoutedEventArgs e)
        {
            var synth = new Windows.Media.SpeechSynthesis.SpeechSynthesizer();
            Windows.Media.SpeechSynthesis.SpeechSynthesisStream stream = await synth.SynthesizeTextToStreamAsync("Hello World");

            var mediaElement = new MediaElement();
            mediaElement.SetSource(stream,stream.ContentType);
            mediaElement.Play();
        }

当我调试它时,我得到一个错误:
An exception of type 'System.IO.FileNotFoundException' occurred in SunnahForKids.exe but was not handled in user code
Additional information: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

最佳答案

MSDN Reference

要求

最低支持的客户端:Windows 8.1

最低支持的服务器:Windows Server 2012 R2

支持的最低电话:Windows Phone 8.1 [仅Windows运行时应用程序]

命名空间:Windows.Media.SpeechSynthesis,Windows::Media::SpeechSynthesis [C++]

关于c# - 使用语音合成器的Windows Store App中的文本到语音,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21664776/

10-12 12:37
查看更多