0

我正在尝试使用 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"\   
4

2 回答 2

0

您将 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."}'
于 2018-10-24T15:29:08.297 回答
-1

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

--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 语音的语音转换。

于 2019-10-08T22:22:27.607 回答