From e98e4bb22f76983c619b4a6c65416149fbf38f83 Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Sat, 6 Jul 2024 14:45:12 -0600 Subject: [PATCH] Update subgen.py Reverted back 16khz test. --- subgen.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/subgen.py b/subgen.py index 1c15cad..0b953b5 100644 --- a/subgen.py +++ b/subgen.py @@ -439,9 +439,8 @@ def asr( task_id = { 'path': f"Bazarr-asr-{random_name}" } task_queue.put(task_id) - audio_data = (np.concatenate([av.audio.resampler.AudioResampler(format='s16', layout='mono', rate=16000).resample(frame).to_ndarray().flatten() for frame in av.open(audio_file.file).decode(audio=0)]).astype(np.float32) / 32768.0) if encode else np.frombuffer(audio_file.file.read(), np.int16).flatten().astype(np.float32) / 32768.0 - - #audio_data = np.frombuffer(audio_file.file.read(), np.int16).flatten().astype(np.float32) / 32768.0 + audio_data = np.frombuffer(audio_file.file.read(), np.int16).flatten().astype(np.float32) / 32768.0 + if model_prompt: custom_prompt = greetings_translations.get(language, '') or custom_model_prompt if custom_regroup: