IBM Watson文本到语音API Python



我正试图调整IBM Watson的宣传,但我似乎找不到任何关于这方面的文档。

如果您访问此链接,您可以看到有一个调整俯仰/速度的选项。

我的代码很简单:

from ibm_watson import TextToSpeechV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator('api_key')
text_to_speech = TextToSpeechV1(
authenticator=authenticator
)
text_to_speech.set_service_url('service_url')
sample = "insert what you want to say here"
with open('test.wav', 'wb') as audio_file:
audio_file.write(
text_to_speech.synthesize(
sample,
voice='en-GB_JamesV3Voice',
accept='audio/wav'
).get_result().content)

我真的不知道该调整什么参数才能让声音变低。非常感谢!

您要查找的是韵律元素。神经语音(V3(仅使用音高速率属性。

使用您的示例:

sample = 'Here is a <prosody pitch="150Hz"> modified pitch </prosody> example.'
sample = 'Here is a <prosody rate="x-slow"> modified rate </prosody> example.'

这里有一个指向有关prosody元素的文档的链接:https://cloud.ibm.com/docs/text-to-speech?topic=text-到语音元素#韵律元素

最新更新