liumaolin
commited on
Commit
·
b446464
1
Parent(s):
57b0084
Increase queue timeout in audio and text processing services for smoother task handling
Browse files
src/voice_dialogue/services/audio/generator.py
CHANGED
|
@@ -60,7 +60,7 @@ class TTSAudioGenerator(BaseThread):
|
|
| 60 |
|
| 61 |
while not self.is_exited:
|
| 62 |
try:
|
| 63 |
-
voice_task: VoiceTask = self.text_input_queue.get(block=False, timeout=
|
| 64 |
except Empty:
|
| 65 |
continue
|
| 66 |
|
|
|
|
| 60 |
|
| 61 |
while not self.is_exited:
|
| 62 |
try:
|
| 63 |
+
voice_task: VoiceTask = self.text_input_queue.get(block=False, timeout=1)
|
| 64 |
except Empty:
|
| 65 |
continue
|
| 66 |
|
src/voice_dialogue/services/audio/player.py
CHANGED
|
@@ -33,7 +33,7 @@ class AudioStreamPlayer(BaseThread):
|
|
| 33 |
while not self.is_exited:
|
| 34 |
|
| 35 |
try:
|
| 36 |
-
voice_task: VoiceTask = self.audio_playing_queue.get(block=False, timeout=
|
| 37 |
except Empty:
|
| 38 |
continue
|
| 39 |
|
|
|
|
| 33 |
while not self.is_exited:
|
| 34 |
|
| 35 |
try:
|
| 36 |
+
voice_task: VoiceTask = self.audio_playing_queue.get(block=False, timeout=1)
|
| 37 |
except Empty:
|
| 38 |
continue
|
| 39 |
|
src/voice_dialogue/services/speech/recognizer.py
CHANGED
|
@@ -33,7 +33,7 @@ class ASRWorker(BaseThread):
|
|
| 33 |
|
| 34 |
while not self.is_exited:
|
| 35 |
try:
|
| 36 |
-
voice_task: VoiceTask = self.user_voice_queue.get(block=False, timeout=
|
| 37 |
except Empty:
|
| 38 |
continue
|
| 39 |
|
|
|
|
| 33 |
|
| 34 |
while not self.is_exited:
|
| 35 |
try:
|
| 36 |
+
voice_task: VoiceTask = self.user_voice_queue.get(block=False, timeout=1)
|
| 37 |
except Empty:
|
| 38 |
continue
|
| 39 |
|
src/voice_dialogue/services/text/generator.py
CHANGED
|
@@ -214,7 +214,7 @@ class LLMResponseGenerator(BaseThread):
|
|
| 214 |
"""主运行循环"""
|
| 215 |
while not self.is_exited:
|
| 216 |
try:
|
| 217 |
-
voice_task: VoiceTask = self.user_question_queue.get(block=False, timeout=
|
| 218 |
self._process_voice_task(voice_task)
|
| 219 |
except Empty:
|
| 220 |
continue
|
|
|
|
| 214 |
"""主运行循环"""
|
| 215 |
while not self.is_exited:
|
| 216 |
try:
|
| 217 |
+
voice_task: VoiceTask = self.user_question_queue.get(block=False, timeout=1)
|
| 218 |
self._process_voice_task(voice_task)
|
| 219 |
except Empty:
|
| 220 |
continue
|