首先去微软申请以下azure语音的api
不同的语音风格可在参考此处:
https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/language-support?tabs=tts
pip install azure-cognitiveservices-speech
import azure.cognitiveservices.speech as speechsdk
import os
# 设置你的Azure语音服务的密钥和区域
speech_key = "xxx"
service_region = "eastasia"
def synthesize_speech(text):
output_dir = "./speech"
os.makedirs(output_dir, exist_ok=True

最低0.47元/天 解锁文章

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



