compatible for voice

This commit is contained in:
lanvent
2023-03-13 00:12:34 +08:00
parent cee57e4ffc
commit 8d2e81815c
6 changed files with 64 additions and 40 deletions

View File

@@ -30,7 +30,8 @@ class BaiduVoice(Voice):
with open(fileName, 'wb') as f:
f.write(result)
logger.info('[Baidu] textToVoice text={} voice file name={}'.format(text, fileName))
return fileName
reply = {"type": "VOICE", "content": fileName}
else:
logger.error('[Baidu] textToVoice error={}'.format(result))
return None
reply = {"type": "ERROR", "content": "抱歉,语音合成失败"}
return reply