From dc5068b2372607f4d7a48597596f2b44cf7d8115 Mon Sep 17 00:00:00 2001 From: brige Date: Wed, 30 Oct 2024 20:07:04 +0800 Subject: [PATCH] add temp commit --- human/audio_inference_handler.py | 1 + human/audio_mal_handler.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/human/audio_inference_handler.py b/human/audio_inference_handler.py index 1ae9283..187ab73 100644 --- a/human/audio_inference_handler.py +++ b/human/audio_inference_handler.py @@ -65,6 +65,7 @@ class AudioInferenceHandler(AudioHandler): except queue.Empty: continue + print('origin mel_batch:', len(mel_batch)) is_all_silence = True audio_frames = [] for _ in range(batch_size * 2): diff --git a/human/audio_mal_handler.py b/human/audio_mal_handler.py index ad4c50a..4a8e281 100644 --- a/human/audio_mal_handler.py +++ b/human/audio_mal_handler.py @@ -58,7 +58,7 @@ class AudioMalHandler(AudioHandler): # print(mel.shape[0],mel.shape,len(mel[0]),len(self.frames)) # cut off stride left = max(0, self._context.stride_left_size * 80 / 50) - # right = min(len(mel[0]), len(mel[0]) - self._context.stride_right_size * 80 / 50) + right = min(len(mel[0]), len(mel[0]) - self._context.stride_right_size * 80 / 50) mel_idx_multiplier = 80. * 2 / self._context.fps mel_step_size = 16 i = 0 @@ -67,8 +67,10 @@ class AudioMalHandler(AudioHandler): start_idx = int(left + i * mel_idx_multiplier) # print(start_idx) if start_idx + mel_step_size > len(mel[0]): + print("AudioMalHandler start_idx", start_idx) mel_chunks.append(mel[:, len(mel[0]) - mel_step_size:]) else: + print("AudioMalHandler start_idx222", start_idx + mel_step_size - start_idx) mel_chunks.append(mel[:, start_idx: start_idx + mel_step_size]) i += 1 self.on_next_handle(mel_chunks, 1)