mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
add
This commit is contained in:
parent
0a731774d1
commit
89baacf295
2 changed files with 3 additions and 3 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue