Why Did I Build This?
"Modern audio consumption is heavily centralized around cloud-based, DRM-locked, and subscription-dependent services like Spotify or Apple Music. I engineered Lain Wave as a direct countermeasure. The objective was to build a highly optimized, telemetry-free, 100% free local-first client that puts users back in control of their data, focusing strictly on high-fidelity (FLAC) archiving without requiring constant internet connectivity."
Architecture & Decisions
The application bridges a SvelteKit file-based routing frontend (`/playlist/[id]`, `/artist/[name]`) with a low-level Tauri Rust backend. The persistence layer utilizes `rusqlite` wrapped in an `Arc<Mutex<Connection>>` to ensure thread-safe concurrent database access. Heavy I/O operations (YouTube scraping, FFmpeg encoding) are strictly isolated within `tauri::async_runtime::spawn_blocking` tasks to prevent UI thread starvation. External binaries (`yt-dlp`, `FFmpeg`) are orchestrated via `std::process::Command` using piped `stdout` buffers, injecting Windows-specific creation flags (`0x08000000`) for headless, stealth execution. Additionally, local AI lyric generation is achieved without cloud APIs by running a C++ GGML Whisper model directly in memory via the `whisper_rs` bindings.
Key Features
- 01.Asynchronous media scraping, ID3 tag injection, and lossless FLAC conversion from YouTube architectures
- 02.On-device, local inference via Whisper AI for automated SRT lyric generation and synchronization
- 03.Lightning-fast local library, artist, and playlist management via a thread-safe SQLite persistence layer
- 04.System-level global media hotkey integration (`tauri_plugin_global_shortcut`)
- 05.Asynchronous state management for real-time Discord Rich Presence (RPC) telemetry