@@ -98,11 +98,12 @@ class ChatChannel(Channel): | |||||
else: | else: | ||||
context.type = ContextType.TEXT | context.type = ContextType.TEXT | ||||
context.content = content | context.content = content | ||||
if 'desire_rtype' not in context and conf().get('always_reply_voice'): | |||||
context['desire_rtype'] = ReplyType.VOICE | |||||
elif context.type == ContextType.VOICE: | elif context.type == ContextType.VOICE: | ||||
if 'desire_rtype' not in context and conf().get('voice_reply_voice'): | if 'desire_rtype' not in context and conf().get('voice_reply_voice'): | ||||
context['desire_rtype'] = ReplyType.VOICE | context['desire_rtype'] = ReplyType.VOICE | ||||
return context | return context | ||||
# 处理消息 TODO: 如果wechaty解耦,此处逻辑可以放置到父类 | # 处理消息 TODO: 如果wechaty解耦,此处逻辑可以放置到父类 | ||||
@@ -47,6 +47,7 @@ available_setting = { | |||||
"speech_recognition": False, # 是否开启语音识别 | "speech_recognition": False, # 是否开启语音识别 | ||||
"group_speech_recognition": False, # 是否开启群组语音识别 | "group_speech_recognition": False, # 是否开启群组语音识别 | ||||
"voice_reply_voice": False, # 是否使用语音回复语音,需要设置对应语音合成引擎的api key | "voice_reply_voice": False, # 是否使用语音回复语音,需要设置对应语音合成引擎的api key | ||||
"always_reply_voice": False, # 是否一直使用语音回复 | |||||
"voice_to_text": "openai", # 语音识别引擎,支持openai,google,azure | "voice_to_text": "openai", # 语音识别引擎,支持openai,google,azure | ||||
"text_to_voice": "baidu", # 语音合成引擎,支持baidu,google,pytts(offline),azure | "text_to_voice": "baidu", # 语音合成引擎,支持baidu,google,pytts(offline),azure | ||||