修改IO路径
This commit is contained in:
parent
a4311f824d
commit
dba63f5154
|
|
@ -227,4 +227,4 @@ service = ASRService(device="auto")
|
|||
本项目使用 Apache-2.0 许可证
|
||||
|
||||
## 运行
|
||||
run.bat VID_20251031_132320_019_mono.wav
|
||||
run.bat input/VID_20251031_132320_019_mono.wav
|
||||
|
|
@ -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}")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue