我如何通过curl调整Watson的Text to Speech服务中的语音速度?

问题描述 投票:0回答:1

**没有编码经验,等

我在SSML的中断语法中找到了答案,但不确定是否可以将其与神经语音(V3)一起使用+不确定(如果此处的问题是,)我可以在卷曲中插入这些中断语法的位置命令

text-to-speech ibm-watson
1个回答
0
投票

API文档中用于语音合成的cURL命令为https://cloud.ibm.com/apidocs/text-to-speech#synthesize-audio-get

curl -X GET -u "apikey:{apikey}" --output hello_world.wav "{url}/v1/synthesize?accept=audio%2Fwav&text=Hello%20world&voice=en-US_AllisonV3Voice"

正在处理的文本是

text=Hello%20world

如果需要添加例如SSML语音转换,则>]

<voice-transformation rate="slow">
  Hello World
</voice-transformation>

然后您需要将HTML字符转义为

text=&lt;voice-transformation rate=&quot;slow&quot;&gt;Hello%20world&lt;voice-transformation rate=&quot;slow&quot;&gt;

制作完整的cURL

curl -X GET -u "apikey:{apikey}" --output hello_world.wav "{url}/v1/synthesize?accept=audio%2Fwav&amp;text=&lt;voice-transformation rate=&quot;slow&quot;&gt;Hello%20world&lt;voice-transformation rate=&quot;slow&quot;&gt;&amp;voice=en-US_AllisonV3Voice"
    
© www.soinside.com 2019 - 2024. All rights reserved.