Sambert语音合成
复制成功!
语音合成
概述
语音合成
提供SAMBERT+NSFGAN深度神经网络算法与传统领域知识深度结合的文字转语音服务,兼具读音准确,韵律自然,声音还原度高,表现力强的特点。
输入
文本
输出
音频
功能
前缀补全
函数调用
缓存
结构化输出
批量任务
联网搜索
微调
定价
- Sambert 语音合成¥1每万字符
速率限制
API 参考
获取 API Key复制成功!
1234567891011121314151617
# coding=utf-8
import sys
from dashscope.audio.tts import SpeechSynthesizer
# 若没有将API Key配置到环境变量中,需将apiKey替换为自己的API Key
# import dashscope
# dashscope.api_key = "apiKey"
result = SpeechSynthesizer.call(model='sambert-zhimao-v1',
text='今天天气怎么样',
sample_rate=48000,
format='wav')
if result.get_audio_data() is not None:
with open('output.wav', 'wb') as f:
f.write(result.get_audio_data())
print('SUCCESS: get audio data: %dbytes in output.wav' %
(sys.getsizeof(result.get_audio_data())))
else:
print('ERROR: response is %s' % (result.get_response()))