[本地语音降噪]:完成本地语音链路和噪音过滤,包含降噪模型、本地ASR和实时字幕稳定策略

This commit is contained in:
mkbk
2026-06-17 22:55:33 +08:00
parent a77a172412
commit 8c75fc5baf
22 changed files with 803 additions and 64 deletions
+13
View File
@@ -16,6 +16,8 @@ if str(SRC_DIR) not in sys.path:
sys.path.insert(0, str(SRC_DIR))
from owner_voice_pet.speech_models import (
DEFAULT_DENOISER_PATH,
DEFAULT_DENOISER_URL,
DEFAULT_KWS_DIR,
DEFAULT_KWS_KEYWORDS,
DEFAULT_KWS_URL,
@@ -38,6 +40,7 @@ def main(argv: list[str] | None = None) -> int:
download_kws(target, force=args.force)
download_vad(target, force=args.force)
download_stt(target, force=args.force)
download_denoiser(target, force=args.force)
manifest = write_default_manifest(target)
status = check_speech_models(target, require_sherpa=False)
print(f"models_dir={target}")
@@ -112,6 +115,16 @@ def download_stt(models_dir: Path, *, force: bool = False) -> Path:
return output_dir
def download_denoiser(models_dir: Path, *, force: bool = False) -> Path:
output = models_dir / DEFAULT_DENOISER_PATH
if output.exists() and not force:
print(f"skip existing {output}")
return output
output.parent.mkdir(parents=True, exist_ok=True)
download_file(DEFAULT_DENOISER_URL, output)
return output
def download_file(url: str, output: Path) -> None:
tmp_output = output.with_suffix(output.suffix + ".part")
print(f"download {url}")