From dba63f51545e41f07c684cf436ced6e05188f6c1 Mon Sep 17 00:00:00 2001 From: yueliuli <1628111725@qq.com> Date: Wed, 29 Apr 2026 10:44:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9IO=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- test_asr.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4300225..290ff83 100644 --- a/README.md +++ b/README.md @@ -227,4 +227,4 @@ service = ASRService(device="auto") 本项目使用 Apache-2.0 许可证 ## 运行 -run.bat VID_20251031_132320_019_mono.wav \ No newline at end of file +run.bat input/VID_20251031_132320_019_mono.wav \ No newline at end of file diff --git a/test_asr.py b/test_asr.py index 65ddef7..eba705e 100644 --- a/test_asr.py +++ b/test_asr.py @@ -58,11 +58,11 @@ def test_single_audio(audio_path: str, model_name: str = "paraformer-zh"): base_name = Path(audio_path).stem # 导出 JSON - json_path = f"{base_name}_result.json" + json_path = f"output/{base_name}_result.json" service.export_to_json(sentences, json_path) # type: ignore # 导出 SRT 字幕 - srt_path = f"{base_name}_result.srt" + srt_path = f"output/{base_name}_result.srt" service.export_to_srt(sentences, srt_path) # type: ignore print("\n" + "=" * 70) @@ -103,7 +103,7 @@ def test_batch(audio_dir: str, model_name: str = "paraformer-zh"): # 导出 base_name = audio_path.stem - service.export_to_json(sentences, f"{base_name}_result.json") # type: ignore + service.export_to_json(sentences, f"output/{base_name}_result.json") # type: ignore except Exception as e: print(f" ✗ 失败: {e}")