无人直播语音合成服务-阿里云sambert大模型

无人直播的使用场景下,我们需要一个效果不错的语音合成服务

阿里云sambert

https://help.aliyun.com/zh/dashscope/developer-reference/quick-start-13
Sambert系列模型 1万字1元 ,每主账号每模型每月3万字免费,

创建API-KEY

https://dashscope.console.aliyun.com/apiKey

调用代码生成音频文件

pip install dashscope
import dashscope
from dashscope.audio.tts import SpeechSynthesizer

dashscope.api_key='sk-xxx'

result = SpeechSynthesizer.call(model='sambert-zhimao-v1',
                                text='今天天气怎么样',
                                sample_rate=48000)
if result.get_audio_data() is not None:
    with open('output.wav', 'wb') as f:
        f.write(result.get_audio_data())

联系方式

vx:  llike620

 
posted @ 2024-05-25 13:09  唯一客服系统开发笔记  阅读(93)  评论(0)    收藏  举报