Skip to content

Commit

Permalink
test azure tts
Browse files Browse the repository at this point in the history
  • Loading branch information
geekan committed Jul 3, 2023
1 parent acf3802 commit 84f55a6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,4 @@ examples/nb/
workspace/*
*.mmd
tmp
output.wav
4 changes: 2 additions & 2 deletions metagpt/actions/azure_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def __init__(self, name, context=None, llm=None):

# 参数参考: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)

Expand Down
2 changes: 1 addition & 1 deletion tests/metagpt/actions/test_azure_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ def test_azure_tts():
"你好,我是卡卡",
"output.wav")

# 运行需要先配置SUBSCRIPTION_KEY
# 运行需要先配置 SUBSCRIPTION_KEY
# TODO: 这里如果要检验,还要额外加上对应的asr,才能确保前后生成是接近一致的,但现在还没有

0 comments on commit 84f55a6

Please sign in to comment.