diff --git a/main/xiaozhi-server/core/connection.py b/main/xiaozhi-server/core/connection.py index 0139037ff..3a944b9ee 100644 --- a/main/xiaozhi-server/core/connection.py +++ b/main/xiaozhi-server/core/connection.py @@ -609,7 +609,7 @@ class ConnectionHandler: try: # Use the existing chat method - if 1:#hasattr(self.tts, 'provider_name') and self.tts.provider_name == 'linkerai' and 'double_stream' in self.tts.stream_mode: + if hasattr(self.tts, 'provider_name') and self.tts.provider_name == 'linkerai' and 'double_stream' in self.tts.stream_mode: self.logger.bind(tag=TAG).info(f"self.tts.provider_name: { self.tts.provider_name} {self.tts.stream_mode}") self.chat_double_stream(text) else: diff --git a/main/xiaozhi-server/core/handle/sendAudioHandle.py b/main/xiaozhi-server/core/handle/sendAudioHandle.py index 2d85c4318..43b7aea8e 100644 --- a/main/xiaozhi-server/core/handle/sendAudioHandle.py +++ b/main/xiaozhi-server/core/handle/sendAudioHandle.py @@ -37,7 +37,7 @@ async def sendAudioStream(conn, audios): if isinstance(audios,types.GeneratorType): count = 0 - async for opus_packet in audios: + for opus_packet in audios: if opus_packet.startswith(b'text:'): await send_tts_message(conn, "sentence_start", opus_packet.replace(b'text:','').decode('utf-8')) continue @@ -73,7 +73,7 @@ async def sendAudio(conn, audios): if isinstance(audios,types.GeneratorType): count = 0 - async for opus_packet in audios: + for opus_packet in audios: if len(opus_packet) < 1: continue if count < 3: