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
d513368aac
commit
775f62da1a
1 changed files with 3 additions and 3 deletions
|
|
@ -556,13 +556,13 @@ class ConnectionHandler:
|
||||||
def _audio_play_priority_thread(self):
|
def _audio_play_priority_thread(self):
|
||||||
while not self.stop_event.is_set():
|
while not self.stop_event.is_set():
|
||||||
text = None
|
text = None
|
||||||
try:
|
if 1:#try:
|
||||||
opus_datas, text, text_index = self.audio_play_queue.get()
|
opus_datas, text, text_index = self.audio_play_queue.get()
|
||||||
future = asyncio.run_coroutine_threadsafe(sendAudioMessage(self, opus_datas, text, text_index),
|
future = asyncio.run_coroutine_threadsafe(sendAudioMessage(self, opus_datas, text, text_index),
|
||||||
self.loop)
|
self.loop)
|
||||||
future.result()
|
future.result()
|
||||||
except Exception as e:
|
# except Exception as e:
|
||||||
self.logger.bind(tag=TAG).error(f"audio_play_priority priority_thread: {text} {e}")
|
# self.logger.bind(tag=TAG).error(f"audio_play_priority priority_thread: {text} {e}")
|
||||||
|
|
||||||
def speak_and_play(self, text, text_index=0):
|
def speak_and_play(self, text, text_index=0):
|
||||||
if text is None or len(text) <= 0:
|
if text is None or len(text) <= 0:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue