From 9250cef4078d07f212fe6a725cb417aaf39392c8 Mon Sep 17 00:00:00 2001 From: brige Date: Sat, 14 Sep 2024 14:21:38 +0800 Subject: [PATCH] modify audio frame output --- Human.py | 5 ++++- tts/Chunk2Mal.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Human.py b/Human.py index 2935a7d..4c1e41c 100644 --- a/Human.py +++ b/Human.py @@ -90,7 +90,7 @@ def inference(render_event, batch_size, face_images_path, audio_feat_queue, audi audio_frames = [] is_all_silence = True for _ in range(batch_size * 2): - frame, type = audio_feat_queue.get() # is erro + frame, type = audio_out_queue.get() audio_frames.append((frame, type)) if type == 0: @@ -205,6 +205,9 @@ class Human: self._feat_queue.put(mel_chunks) print("22") + def push_audio_frames(self, chunk, type_): + self._output_queue.put((chunk, type_)) + def render(self): try: img, aud = self._res_frame_queue.get(block=True, timeout=.3) diff --git a/tts/Chunk2Mal.py b/tts/Chunk2Mal.py index 8396e78..431c4ba 100644 --- a/tts/Chunk2Mal.py +++ b/tts/Chunk2Mal.py @@ -21,8 +21,9 @@ class Chunk2Mal: logging.info('chunk2mal run') while not self._exit_event.is_set(): try: - chunk, type = self.pull_chunk() + chunk, type_ = self.pull_chunk() self._chunks.append(chunk) + self._human.push_audio_frame((chunk, type_)) print("1") except queue.Empty: continue