This commit is contained in:
seven 2025-03-28 22:05:43 +08:00
parent 0a731774d1
commit 89baacf295
2 changed files with 3 additions and 3 deletions

View file

@ -609,7 +609,7 @@ class ConnectionHandler:
try: try:
# Use the existing chat method # 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.logger.bind(tag=TAG).info(f"self.tts.provider_name: { self.tts.provider_name} {self.tts.stream_mode}")
self.chat_double_stream(text) self.chat_double_stream(text)
else: else:

View file

@ -37,7 +37,7 @@ async def sendAudioStream(conn, audios):
if isinstance(audios,types.GeneratorType): if isinstance(audios,types.GeneratorType):
count = 0 count = 0
async for opus_packet in audios: for opus_packet in audios:
if opus_packet.startswith(b'text:'): if opus_packet.startswith(b'text:'):
await send_tts_message(conn, "sentence_start", opus_packet.replace(b'text:','').decode('utf-8')) await send_tts_message(conn, "sentence_start", opus_packet.replace(b'text:','').decode('utf-8'))
continue continue
@ -73,7 +73,7 @@ async def sendAudio(conn, audios):
if isinstance(audios,types.GeneratorType): if isinstance(audios,types.GeneratorType):
count = 0 count = 0
async for opus_packet in audios: for opus_packet in audios:
if len(opus_packet) < 1: if len(opus_packet) < 1:
continue continue
if count < 3: if count < 3: