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