modify pause talk

This commit is contained in:
jiegeaiai 2024-10-20 03:28:49 +08:00
parent 055d1733f3
commit 362307f9f7
3 changed files with 8 additions and 1 deletions

View File

@ -121,3 +121,7 @@ class AudioInferenceHandler(AudioHandler):
def stop(self): def stop(self):
self._exit_event.clear() self._exit_event.clear()
self._run_thread.join() self._run_thread.join()
def pause_talk(self):
self._audio_queue.queue.clear()
self._mal_queue.queue.clear()

View File

@ -89,3 +89,6 @@ class AudioMalHandler(AudioHandler):
if self._thread.is_alive(): if self._thread.is_alive():
self._thread.join() self._thread.join()
logging.info('chunk2mal stop') logging.info('chunk2mal stop')
def pause_talk(self):
self._queue.queue.clear()

View File

@ -21,7 +21,7 @@ except ImportError as e:
def main(): def main():
print("Started! Please speak") print("Started! Please speak")
handle = TTSAudioSaveHandle() handle = TTSAudioSaveHandle(None, None)
tts = TTSEdge(handle) tts = TTSEdge(handle)
split = PunctuationSplit() split = PunctuationSplit()
nlp = DouBao(split, tts) nlp = DouBao(split, tts)