Compare commits

..

No commits in common. "d95288d63e97dffd89848d80e2f0b0384c5becba" and "b659e227089188e49084175e231e460e6e23a77b" have entirely different histories.

9 changed files with 5 additions and 15 deletions

View File

Before

Width:  |  Height:  |  Size: 452 KiB

After

Width:  |  Height:  |  Size: 452 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 KiB

View File

@ -34,7 +34,7 @@ class AudioMalHandler(AudioHandler):
logging.info('chunk2mal run')
while self._exit_event.is_set():
self._run_step()
time.sleep(0.3)
time.sleep(0.01)
logging.info('chunk2mal exit')

View File

@ -104,7 +104,7 @@ class HumanContext:
self._tts_handle = TTSAudioSplitHandle(self, self._mal_handler)
self._tts = TTSEdgeHttp(self._tts_handle)
split = PunctuationSplit()
self._nlp = DouBao(self, split, self._tts)
self._nlp = DouBao(split, self._tts)
self._asr = SherpaNcnnAsr()
self._asr.attach(self._nlp)
@ -113,4 +113,3 @@ class HumanContext:
self._tts.pause_talk()
self._mal_handler.pause_talk()
self._infer_handler.pause_talk()
self._render_handler.pause_talk()

View File

@ -40,10 +40,6 @@ class HumanRender(AudioHandler):
type_ = 0
self._video_render.put((res_frame, idx, type_))
def pause_talk(self):
self._voice_render.pause_talk()
self._video_render.pause_talk()
def stop(self):
self._voice_render.stop()
self._video_render.stop()

View File

@ -8,9 +8,8 @@ logger = logging.getLogger(__name__)
class NLPBase(AsrObserver):
def __init__(self, context, split, callback=None):
def __init__(self, split, callback=None):
self._ask_queue = AsyncTaskQueue()
self._context = context
self._split_handle = split
self._callback = callback
@ -37,7 +36,6 @@ class NLPBase(AsrObserver):
def completed(self, message: str):
logger.info(f'complete:{message}')
self._context.pause_talk()
self.ask(message)
def ask(self, question):

View File

@ -10,8 +10,8 @@ logger = logging.getLogger(__name__)
class DouBao(NLPBase):
def __init__(self, context, split, callback=None):
super().__init__(context, split, callback)
def __init__(self, split, callback=None):
super().__init__(split, callback)
logger.info("DouBao init")
# Access Key ID
# AKLTYTdmOTBmNWFjODkxNDE2Zjk3MjU0NjRhM2JhM2IyN2Y

View File

@ -30,9 +30,6 @@ class BaseRender(ABC):
ps = time.time() - self._play_clock.start_time
self._queue.put_nowait((frame, ps))
def pause_talk(self):
self._queue.queue.clear()
def stop(self):
self._queue.queue.clear()
self._exit_event.clear()