【问题标题】:SSML code in Curl text to speech IBM WatsonCurl 文本到语音中的 SSML 代码 IBM Watson
【发布时间】:2019-03-23 10:15:03
【问题描述】:

我正在尝试使用 IBM Watson Text to Speech,因为我需要获取一些音频文件以插入到视频中,但我根本不是开发人员!查看 IBM 云网站上提供的稀有教程,我想出了如何使用 curl 获取音频文件。但我找不到使用 SSML 可能性来修改声音的方法。我不明白我们必须在代码中的哪里指定标签。这是我使用的代码,它可以生成音频文件。我应该在哪里插入标签来自定义声音?...任何帮助都非常受欢迎!非常感谢提前

curl -X POST -u "credential OK":"credential ok" \        
--header "Content-Type: application/json" \        
--header "Accept: audio/mp3" \        
--data '{"text": "The visceral leishmaniasis, also known as kala-azar is characterized by irregular bouts of fever, substantial weight loss, swelling of the spleen and liver, and anaemia. Visceral leishmaniasis is fatal in over 95% of cases if left untreated."}' \        
--output Essai.mp3 \        
"https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize?voice=en-US_AllisonVoice"\   

【问题讨论】:

    标签: text-to-speech ibm-watson ssml


    【解决方案1】:

    您将 SSML 标签放在需要应用的文本周围

    例如。以你为例

    --data '{"text": "<express-as type='GoodNews'> The visceral leishmaniasis, also known as kala-azar </express-as> is characterized by irregular bouts of fever, substantial weight loss, swelling of the spleen and liver, and anaemia. Visceral leishmaniasis is fatal in over 95% of cases if left untreated."}'
    

    【讨论】:

    • 感谢您的意见。我试了一下,但它返回给我一个空白的音频文件。知道为什么吗?
    • 检查您的输出是否有错误,您可能会在“当前语音中不支持 ”行中看到某些内容
    • 我在输出中看不到任何错误...我不知道...它创建了文件,但文件为空。所选语音应支持 SSML
    【解决方案2】:

    我知道这个答案来晚了,但它可能会帮助其他有同样问题的人。

    --data "{\"text\": \"<voice-transformation type='Custom' breathiness='35%' pitch='-80%' pitch_range='60%' glottal_tension='-40%' ><p><s>The visceral leishmaniasis, <break strength='500ms'></break>also known as kala-azar, <break strength='500ms'></break> <express-as type='Uncertainty'>is characterized by irregular bouts of fever, substantial weight loss, swelling of the spleen and liver, and anaemia.</express-as></s> <s>Visceral leishmaniasis is fatal in over 95% of cases if left untreated.</s></p></voice-transformation>\"}" \
    

    我认为 chughts 提供的示例不起作用的原因可能是因为 JASON 对象中的引号转义不当。 *另请注意,express-as 元素仅适用于 en-US_AllisonVoice。

    就我个人而言,我无法使用任何 express-as 元素类型选项来区分声音。 FWIW,我更喜欢 en-US_LisaV3Voice,但你不能对 V3 语音使用语音转换。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-21
      • 1970-01-01
      • 2019-06-23
      • 1970-01-01
      • 2016-06-14
      • 2016-07-02
      • 1970-01-01
      • 2021-07-07
      相关资源
      最近更新 更多