From d335042159d02c45f21410470c38845c231f3dd8 Mon Sep 17 00:00:00 2001 From: William Jin Date: Mon, 6 Oct 2025 18:01:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9whisper=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chyoso_toolkit_ui.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chyoso_toolkit_ui.py b/chyoso_toolkit_ui.py index 17c23ed..0690a71 100644 --- a/chyoso_toolkit_ui.py +++ b/chyoso_toolkit_ui.py @@ -45,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 = "/home/tmfc/whisper_output/" + original_filename + ".txt" + txt_file = "/home/tmfc/whisper_output/" + os.path.splitext(original_filename)[0] + ".txt" print(f"音频文件 {wav_file} 转写完成,结果已保存为 {txt_file}") return txt_file @@ -57,10 +57,10 @@ def process_audio(audio_file, offset_time, duration_time): original_filename = os.path.basename(audio_file) # 转换音频文件为 wav 格式 - wav_file = convert_to_wav(audio_file) + # wav_file = convert_to_wav(audio_file) # 转写音频文件 - txt_file = transcribe_audio(wav_file, original_filename, offset_time, duration_time) + txt_file = transcribe_audio(audio_file, original_filename, offset_time, duration_time) print("音频文件处理完成") return txt_file