From f663622deb4c79de80abaf02f53ca03f0f5caf04 Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Thu, 8 Feb 2024 08:49:06 -0700 Subject: [PATCH] Update subgen.py --- subgen/subgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subgen/subgen.py b/subgen/subgen.py index c12eca7..cfc7cc4 100644 --- a/subgen/subgen.py +++ b/subgen/subgen.py @@ -191,7 +191,7 @@ def asr( #give the 'process' a random name so mutliple Bazaar transcribes can operate at the same time. random_name = random.choices("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", k=6) files_to_transcribe.insert(0, f"Bazarr-detect-langauge-{random_name}") - result = model.transcribe_stable(np.frombuffer(audio_file.file.read(), np.int16).flatten().astype(np.float32) / 32768.0, task=task, input_sr=16000) + result = model.transcribe_stable(np.frombuffer(audio_file.file.read(), np.int16).flatten().astype(np.float32) / 32768.0, task=task, input_sr=16000, language=language) elapsed_time = time.time() - start_time minutes, seconds = divmod(int(elapsed_time), 60) print(f"Bazarr transcription is completed, it took {minutes} minutes and {seconds} seconds to complete.")