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}")