//! Lyric alignment, off Windows. The aligner (lyric_align.rs) runs the CTC //! model through Windows ML, so on Android the model is never present, never //! downloaded, and a passage never aligns — lyric_prep's own fallback (the //! line estimate) carries the lyrics instead. This file stands in for the //! module (`#[path]` in lib.rs) with the same names, so lyric_prep, vocal_sep //! and the command list need no cfg of their own. use std::path::PathBuf; pub(crate) fn models_dir(app: &tauri::AppHandle) -> Result { let dir = crate::paths::app_data(app) .map_err(|e| e.to_string())? .join("lyric-models"); std::fs::create_dir_all(&dir).map_err(|e| e.to_string())?; Ok(dir) } pub fn model_present(_app: &tauri::AppHandle) -> bool { false } #[tauri::command] pub fn lyric_model_status(app: tauri::AppHandle) -> serde_json::Value { serde_json::json!({ "present": false, "bytes": 0, "aligner": crate::lyric_prep::active_aligner(&app), "downloadBytes": 0, "unsupported": "word alignment runs on the desktop for now", }) } #[tauri::command] pub async fn lyric_model_download(_app: tauri::AppHandle) -> Result<(), String> { Err("word alignment runs on the desktop for now (Windows ML); not on this platform".into()) } pub struct AlignedWord { pub start_ms: i64, pub end_ms: i64, } pub struct AlignedLine { pub words: Vec, pub confidence: f32, } pub fn align_passage( _app: &tauri::AppHandle, _pcm: &[f32], _lines: &[Vec], _floors_ms: &[i64], _ceils_ms: &[i64], ) -> Result, String> { Err("aligner unavailable on this platform".into()) }