forked from Keelrleek/SoulStream
feat: normalize preview clips to -14 LUFS to match the library
Deezer preview clips are cut from the raw master (not pre-normalized), so they played several dB hotter than the user's normalized -14 LUFS files — measured across one artist the previews ranged -0.1 to -8.8 dB from target, an 8.7 dB spread, so a flat offset would have been wrong either way. Each clip is now measured with the same BS.1770 meter the main player uses (preview.rs measure_clip_gain -> loudness::normalization_gain_db) right after it is written in preview_resolve -- off the async worker, and fully off the playback path on a prefetched neighbour. The linear gain is stored in the lease and the reuse cache, and rides UNDER the app-volume mirror per voice (effective = target_vol * clip_gain), so it composes with the slider, mute and the crossfade (each clip crosses in at its own matched level). Gated on the volume_normalization setting; reset on dispose. Debug overlay PREVIEW row now shows the active clip's norm dB. Verified live: per-clip gains -0.1..-8.8 dB applied; mute still zeroes the preview; 39 app + 12 player tests pass.
This commit is contained in:
1 parent
abc959ca2f
commit
28aba3a3b3
4 files changed
+109
-21
No files matched your search
@@ -125,6 +125,7 @@
|
||||
{previewUi.snapshot?.phase ?? "—"} · gen {previewUi.snapshot?.requestGeneration ?? "—"} ·
|
||||
idx {previewUi.snapshot?.activeManifestIndex ?? "—"}
|
||||
{#if stats.previewVolume != null}· vol {stats.previewVolume.toFixed(2)}{/if}
|
||||
{#if stats.previewNormDb != null}· norm {stats.previewNormDb >= 0 ? "+" : ""}{stats.previewNormDb.toFixed(1)} dB{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user