From 65439486ce2005e5b154542385a3c26191a94ee8 Mon Sep 17 00:00:00 2001 From: William Jin Date: Mon, 6 Oct 2025 17:51:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9whisper=E9=9F=B3=E9=A2=91?= =?UTF-8?q?=E8=BD=AC=E5=86=99=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chyoso_toolkit_ui.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/chyoso_toolkit_ui.py b/chyoso_toolkit_ui.py index 6f4578b..17c23ed 100644 --- a/chyoso_toolkit_ui.py +++ b/chyoso_toolkit_ui.py @@ -29,13 +29,11 @@ def convert_to_wav(audio_file): def transcribe_audio(wav_file, original_filename, offset_time, duration_time): # 调用 whisper 命令行程序进行转写 whisper_cmd = [ - "/home/tmfc/apps/whisper/main", - "--language", "Chinese", - "-otxt", - "-ot", str(offset_time * 1000), - "-d", str(duration_time * 1000), - "-of", "/home/tmfc/apps/whisper/" + original_filename, - "-m", "/home/tmfc/apps/whisper/models/ggml-large-v3-q5_0.bin", + "/home/tmfc/apps/whisper/.venv/bin/whisper", + "--language", "zh", + "--output_dir", "/home/tmfc/whisper_output/", + "--output_format", "txt", + "--model", "turbo", wav_file ] print(whisper_cmd) @@ -47,7 +45,7 @@ def transcribe_audio(wav_file, original_filename, offset_time, duration_time): # with open(txt_file, "w") as f: # f.write(result.stdout) - txt_file = original_filename + ".txt" + txt_file = "/home/tmfc/whisper_output/" + original_filename + ".txt" print(f"音频文件 {wav_file} 转写完成,结果已保存为 {txt_file}") return txt_file