android: the phone, on the real core — the mockup shell, playback, the media card, the catalog, the resolver, Save, the dev flavour
The same Tauri 2 project builds for Android: mobile.html as a third Vite
entry (src/mobile/, the mockup on real data), tauri.android.conf.json, the
mobile stubs (updater, lyric alignment, vocal separation), rustls reqwest
on Android, the AAudio buffer, and a hand-driven detour build
(src-tauri/android/{env,build,deploy,dev}.sh) while Developer Mode is off.
ANDROID.md is the recipe.
Playback: the media-session plugin crate (lock-screen card, MediaStyle
notification, audio focus, headset buttons, a foreground service that
promotes itself first — Android 14 kills the app otherwise), session
restore across reload and restart, solid chrome after measuring the
backdrop-filter lag.
The catalog: Search is the desktop's top bar (the top-result rule, artist
cards), the artist page and the record page are the desktop's, Home is the
desktop's landing page, Gaps per followed shelf. Playing goes through the
desktop's own source rules, moved verbatim from state.svelte.js into
src/lib/sources.js so both apps share one resolver; the phone readies the
next three tracks and crosses boundaries gapless. Save fetches a record or
a track into the library by the download rules; Transfers shows the
burst. The raw Soulseek search stays, offered on request, a peer's copy
streaming with the lane rising as the bytes arrive. Community is the
Soulseek side (rooms, chat, buddies); the private layer waits.
The opener and storage plugins (social links, the picked library folder,
all-files access), the volume normalization switch, and the harness:
tests/mobile/smoke.mjs walks the mock (a fake network behind
src/lib/events.js) and the real phone over CDP, perf.mjs measures frames.
This commit is contained in:
1 parent
972dd103cb
commit
bb828ff2dc
102 files changed
+12258
-830
No files matched your search
@@ -0,0 +1,56 @@
|
||||
//! 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<PathBuf, String> {
|
||||
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<AlignedWord>,
|
||||
pub confidence: f32,
|
||||
}
|
||||
|
||||
pub fn align_passage(
|
||||
_app: &tauri::AppHandle,
|
||||
_pcm: &[f32],
|
||||
_lines: &[Vec<String>],
|
||||
_floors_ms: &[i64],
|
||||
_ceils_ms: &[i64],
|
||||
) -> Result<Vec<AlignedLine>, String> {
|
||||
Err("aligner unavailable on this platform".into())
|
||||
}
|
||||
Reference in new issue
Block a user