test azure tts

This commit is contained in:
geekan 2023-07-03 10:57:06 +08:00
parent acf3802bee
commit 84f55a6df7
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View file

@ -161,3 +161,4 @@ examples/nb/
workspace/*
*.mmd
tmp
output.wav

View file

@ -17,8 +17,8 @@ class AzureTTS(Action):
# 参数参考https://learn.microsoft.com/zh-cn/azure/cognitive-services/speech-service/language-support?tabs=tts#voice-styles-and-roles
def synthesize_speech(self, lang, voice, role, text, output_file):
subscription_key = self.config.get('SUBSCRIPTION_KEY')
region = self.config.get('REGION')
subscription_key = self.config.get('AZURE_TTS_SUBSCRIPTION_KEY')
region = self.config.get('AZURE_TTS_REGION')
speech_config = SpeechConfig(
subscription=subscription_key, region=region)

View file

@ -17,5 +17,5 @@ def test_azure_tts():
"你好,我是卡卡",
"output.wav")
# 运行需要先配置SUBSCRIPTION_KEY
# 运行需要先配置 SUBSCRIPTION_KEY
# TODO: 这里如果要检验还要额外加上对应的asr才能确保前后生成是接近一致的但现在还没有