# coding=utf-8
import dashscope
from dashscope.audio.tts import SpeechSynthesizer
dashscope.api_key='你的key'
result = SpeechSynthesizer.call(model='sambert-zhiqi-v1',
text='你好我好大家好',
sample_rate=48000,
rate=1.2,
format='wav')
if result.get_audio_data() is not None:
with open('output.wav', 'wb') as f:
f.write(result.get_audio_data())
print(' get response: %s' % (result.get_response()))
使用阿里云的SpeechSynthesizer实现语音合成
最新推荐文章于 2024-10-08 16:16:55 发布

468

被折叠的 条评论
为什么被折叠?



