【问题标题】:Speechsynthesizer (System.Speech.Synthesis.SpeechSynthesizer) - Changing the volume or rate at runtimeSpeechsynthesizer (System.Speech.Synthesis.SpeechSynthesizer) - 在运行时改变音量或速率
【发布时间】:2015-04-24 20:02:51
【问题描述】:
string TextToBeRead = "My sample text";
SpeechSynthesizer speaker = new SpeechSynthesizer();
speaker.Rate = 5;
speaker.Volume = 70;
speaker.SpeakAsync(TextToBeRead);

有什么方法可以在扬声器开始讲话后更改速率或音量?我试图在运行时更改它,但输出仍然使用旧的速率和音量。谢谢。

【问题讨论】:

标签: c# speech-recognition text-to-speech sapi speech-synthesis


【解决方案1】:

不,您不能在阅读时更改它,但您可以订阅 SpeakProgress 事件,以便获取 CharacterPosition 并在给定位置以新的速率和音量重新开始讲话

【讨论】:

    【解决方案2】:

    您可以使用 SSML prosody element 以及速率和音量属性进行内联操作。

    您需要在 SpeechSynthesizer 上使用 SpeakSsmlAsync 方法来完成这项工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-05-23
      • 1970-01-01
      • 2022-01-26
      • 1970-01-01
      • 2011-03-03
      • 2020-05-15
      • 1970-01-01
      相关资源
      最近更新 更多