fix: piper 加 ESPEAK_DATA_PATH 环境变量 (espeak-ng-data 目录)

This commit is contained in:
2026-07-04 17:10:23 +08:00
parent dc20fd3502
commit a3052ad6db
6 changed files with 23 additions and 6 deletions

View File

@@ -50,6 +50,7 @@ impl AiPlugin {
whisper_lib_dir: Option<PathBuf>,
piper_lib_dir: Option<PathBuf>,
piper_config: Option<PathBuf>,
espeak_data_dir: Option<PathBuf>,
tmp_dir: PathBuf,
context_window: usize,
) -> Self {
@@ -57,8 +58,9 @@ impl AiPlugin {
if let Some(lib_dir) = whisper_lib_dir {
backend_builder = backend_builder.with_whisper_lib_dir(lib_dir);
}
if let (Some(lib_dir), Some(config)) = (piper_lib_dir, piper_config) {
backend_builder = backend_builder.with_piper_deps(lib_dir, config);
// piper 三个依赖必须同时设置
if let (Some(lib_dir), Some(config), Some(espeak_data)) = (piper_lib_dir, piper_config, espeak_data_dir) {
backend_builder = backend_builder.with_piper_deps(lib_dir, config, espeak_data);
}
let backend = Box::new(backend_builder);
let models = model_manager::ModelManager::new(model_store);