gpt4 book ai didi

c# - Windows Phone 8.1 语音合成器访问被拒绝?

转载 作者:行者123 更新时间:2023-11-30 14:10:12 24 4
gpt4 key购买 nike

我正在尝试构建一个在用户按下按钮时与用户对话的应用。

语音合成器代码如下

 Windows.Media.SpeechSynthesis.SpeechSynthesizer x = new Windows.Media.SpeechSynthesis.SpeechSynthesizer();
var stream = await x.SynthesizeTextToStreamAsync(someString);
var mediaElement = new MediaElement();
mediaElement.SetSource(stream, stream.ContentType);
mediaElement.Play();

虽然此代码适用于不同的应用程序,但不适用于此项目。我不断收到以下错误。

  +     e   {System.UnauthorizedAccessException: Access is denied. Access is denied. at Windows.Media.SpeechSynthesis.SpeechSynthesizer..ctor()  at TalkingWalkingMaps.ManeuverDisplayer.<DisplayManeuver>d__0.MoveNext()}    System.Exception {System.UnauthorizedAccessException}

我在网上看到我必须删除 HKEY_CURRENT_USER\Software\Microsoft\Speech\CurrentUserLexicon 值从我的注册表中使用 regedit 但这不起作用。

有人可以帮忙吗?

最佳答案

事实证明问题源于 App Manifest 文件。虽然乍一看并不直观,但必须启用麦克风功能才能使语音合成器工作。 enter image description here

关于c# - Windows Phone 8.1 语音合成器访问被拒绝?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25203787/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com