mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
compatible for voice
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user