【问题标题】:Text To Speech universal app doesn't work文本到语音通用应用程序不起作用
【发布时间】:2015-11-15 18:15:38
【问题描述】:

此代码在 windows 通用应用程序 10 中不起作用

        var mediaPronunciation = new MediaElement();

        using (var speech = new SpeechSynthesizer())
        {
            speech.Voice = SpeechSynthesizer.AllVoices
                .First(i => i.Gender == VoiceGender.Male);

            var voiceStream = await speech.SynthesizeTextToStreamAsync("fast");

            mediaPronunciation.SetSource(voiceStream, voiceStream.ContentType);
            mediaPronunciation.Play();
        }

我遇到了这个错误

{“找不到指定的模块。(来自HRESULT的异常:0x8007007E)”:null}

我找到了这个话题,他也有同样的问题 How do you make Speech to Text work in Windows (Phone) 8.1 Universal App

请帮助我如何解决这个问题?

谢谢

【问题讨论】:

    标签: windows-phone-8.1 text-to-speech win-universal-app speech winrt-async


    【解决方案1】:
    var speech= new SpeechSynthesizer();
    speech.Voice = SpeechSynthesizer.AllVoices
                .First(i => i.Gender == VoiceGender.Male);
    SpeechSynthesisStream sss =await speech.SynthesizeTextToStreamAsync("fast");
    mediaPronunciation.SetSource(sss, sss.ContentType);
    mediaPronunciation.Play();
    

    试试这个...

    【讨论】:

    • 谢谢老兄,它不起作用我认为问题是这个代码speech.SynthesizeTextToStreamAsync("fast"),你知道为什么吗?因为我检查了 Marker 属性并且它是空的,我认为这是主要原因,有些人说语音没有安装在你的操作系统中,但我确定这不是问题
    • 查看 Package.appxmanifest 中的麦克风 --> 麦克风
    • 它没有被检查,但我检查了它仍然无法工作。
    • 我使用此示例 --> github.com/Microsoft/Windows-universal-samples/tree/master/… 并且我处理此消息的错误 ->媒体播放器组件不可用
    • 这完全与 mediaElement 有关
    【解决方案2】:

    最后我解决了这个问题, 每个人都必须为播放器下载此文件: Download and install media pack for N SKU of Windows 10 introduced , 现在您可以享受使用 Text To Speech 的乐趣了

    非常感谢 Fred 先生 -> My question in MSDN

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-14
      • 2013-06-19
      相关资源
      最近更新 更多