feat(player): play every song at a similar volume with ReplayGain
I want songs from different albums to play at about the same loudness without touching the volume. - The scan reads REPLAYGAIN_TRACK_GAIN, REPLAYGAIN_ALBUM_GAIN and the two peaks from each file, offline, and keeps them on the file (migration 0029, SQLite and PostgreSQL). A tag that makes no sense (not a number, more than 60 dB) is left out. Files indexed before have none until a full rescan. - A track in the API carries them as replay_gain (null when its first playable file says nothing). - The web player levels each song with them: the sound passes through a gain node, so a quiet song can be raised too, but never so much that its peak would clip (and never more than 12 dB when there is no peak). Without Web Audio the element is turned down instead. - A new Playback section in Settings chooses song by song (default), album by album or off; the choice stays on the device. - README: the ReplayGain entry, and the old line that said the year was not in the index is removed. - English and Italian.
This commit is contained in:
parent
e9f85c2f39
commit
a92326c1b4
2 changed files with 672 additions and 23 deletions
6
migrations/postgres/0029_replaygain.sql
Normal file
6
migrations/postgres/0029_replaygain.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
-- PostgreSQL flavour of sqlite/0029_replaygain.sql.
|
||||
|
||||
ALTER TABLE audio_files ADD COLUMN rg_track_gain DOUBLE PRECISION;
|
||||
ALTER TABLE audio_files ADD COLUMN rg_album_gain DOUBLE PRECISION;
|
||||
ALTER TABLE audio_files ADD COLUMN rg_track_peak DOUBLE PRECISION;
|
||||
ALTER TABLE audio_files ADD COLUMN rg_album_peak DOUBLE PRECISION;
|
||||
8
migrations/sqlite/0029_replaygain.sql
Normal file
8
migrations/sqlite/0029_replaygain.sql
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
-- What a file says about its own loudness, from its ReplayGain tags: gains in decibels, peaks as a fraction of full
|
||||
-- scale. NULL when the file has none, and for the files already indexed until a full rescan reads their tags again.
|
||||
-- The web player uses them to play every song at a similar volume.
|
||||
|
||||
ALTER TABLE audio_files ADD COLUMN rg_track_gain REAL;
|
||||
ALTER TABLE audio_files ADD COLUMN rg_album_gain REAL;
|
||||
ALTER TABLE audio_files ADD COLUMN rg_track_peak REAL;
|
||||
ALTER TABLE audio_files ADD COLUMN rg_album_peak REAL;
|
||||
Loading…
Reference in a new issue