feat(waveform): real amplitude waveform via Symphonia + smooth crossfade

Add Rust command `compute_waveform` that downloads the audio file,
seek-samples 500 evenly-spaced frames with Symphonia (fast path) and
computes peak amplitudes. Percentile-based normalisation (p5→p95)
preserves visible dynamics even for heavily compressed music.

Frontend caches results per track (module-level Map), shows the
pseudo-random fallback immediately and crossfades to the real waveform
over 400 ms (ease-in-out) once the computation finishes.

Also: Settings input-tab reset buttons now use btn-danger styling.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Psychotoxical
2026-04-07 23:31:15 +02:00
parent 5be7f7cabd
commit 504c53e71d
5 changed files with 255 additions and 20 deletions
+1
View File
@@ -994,6 +994,7 @@ pub fn run() {
audio::audio_play_radio,
audio::audio_set_crossfade,
audio::audio_set_gapless,
audio::compute_waveform,
audio::audio_chain_preload,
discord::discord_update_presence,
discord::discord_clear_presence,