diff --git a/core/handle/audioHandle.py b/core/handle/audioHandle.py index 06c32c026..67615a95f 100644 --- a/core/handle/audioHandle.py +++ b/core/handle/audioHandle.py @@ -44,21 +44,6 @@ async def handleAudioMessage(conn, audio): conn.asr_audio.clear() conn.reset_vad_states() -async def speechToText(conn): - conn.client_abort = False - conn.asr_server_receive = False - text, file_path = await conn.asr.speech_to_text(conn.asr_audio, conn.session_id) - logger.info(f"识别文本: {text}") - text_len, text_without_punctuation = remove_punctuation_and_length(text) - if text_len <= conn.max_cmd_length and await handleCMDMessage(conn, text_without_punctuation): - return - if text_len > 0: - await startToChat(conn, text) - else: - conn.asr_server_receive = True - conn.asr_audio.clear() - conn.reset_vad_states() - async def handleCMDMessage(conn, text): cmd_exit = conn.cmd_exit for cmd in cmd_exit: diff --git a/core/providers/tts/fishspeech.py b/core/providers/tts/fishspeech.py index 1cbe08105..5794a2e36 100644 --- a/core/providers/tts/fishspeech.py +++ b/core/providers/tts/fishspeech.py @@ -89,7 +89,7 @@ class TTSProvider(TTSProviderBase): self.channels = config.get("channels",1) self.rate = config.get("rate",44100) self.api_key = config.get("api_key","YOUR_API_KEY") - if not self.api_key or "你" in self.api_key: + if "你" in self.api_key: logger.bind(tag=TAG).error("你还没配置FishSpeech TTS的密钥,请在配置文件中配置密钥,否则无法正常工作") return self.normalize = config.get("normalize",True)