diff --git a/sbv2_api/Cargo.toml b/sbv2_api/Cargo.toml index 4238fa5..3c759ed 100644 --- a/sbv2_api/Cargo.toml +++ b/sbv2_api/Cargo.toml @@ -9,7 +9,7 @@ axum = "0.7.5" dotenvy.workspace = true env_logger.workspace = true log = "0.4.22" -sbv2_core = { version = "0.2.0-alpha2", path = "../sbv2_core" } +sbv2_core = { version = "0.2.0-alpha2", path = "../sbv2_core", features = ["aivmx"] } serde = { version = "1.0.210", features = ["derive"] } tokio = { version = "1.40.0", features = ["full"] } utoipa = { version = "5.0.0", features = ["axum_extras"] } diff --git a/sbv2_api/src/main.rs b/sbv2_api/src/main.rs index 6844c21..254bf2c 100644 --- a/sbv2_api/src/main.rs +++ b/sbv2_api/src/main.rs @@ -140,6 +140,20 @@ impl AppState { log::warn!("Error loading {entry}: {e}"); }; log::info!("Loaded: {entry}"); + } else if name.ends_with(".aivmx") { + let entry = &name[..name.len() - 6]; + log::info!("Try loading: {entry}"); + let aivmx_bytes = match fs::read(format!("{models}/{entry}.aivmx")).await { + Ok(b) => b, + Err(e) => { + log::warn!("Error loading aivmx bytes from file {entry}: {e}"); + continue; + } + }; + if let Err(e) = tts_model.load_aivmx(entry, aivmx_bytes) { + log::error!("Error loading {entry}: {e}"); + } + log::info!("Loaded: {entry}"); } } for entry in entries {