Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ReplayGain support #141

Merged
merged 1 commit into from
Dec 29, 2024
Merged

add ReplayGain support #141

merged 1 commit into from
Dec 29, 2024

Conversation

sentriz
Copy link
Contributor

@sentriz sentriz commented Dec 17, 2024

Add a quick toggle to choose between

  • no ReplayGain
  • album level ReplayGain (nice when you're listening to many albums, preserving the dynamic range of each)
  • track level ReplayGain (nice if you're listing to a mixed playlist)

ReplayGain 2.0 is specfifed here https://wiki.hydrogenaud.io/index.php?title=ReplayGain_2.0_specification

Settings are only applied if a valid replayGain object in the song response

20241217_204019.mp4

@tamland
Copy link
Owner

tamland commented Dec 26, 2024

Thanks! Is there any reason to not just always apply track level ReplayGain? I prefer to reduce unnecessary options if possible

@sentriz
Copy link
Contributor Author

sentriz commented Dec 26, 2024

if track level replaygain is always applied, you run the risk of changing the dynamics of tracks within an album. so an intro track the artist intented to a be quiet would now be louder

that said, doing it at a track level is good if the user is listening to a playlist of tracks from lots of places and wants to normalise them all

kind of depends on your listening mode. that's why I thought the toggle would be nice there 👌

@@ -144,12 +171,46 @@ export class AudioController {
return
}
const elapsed = Date.now() - startTime
this.audio.volume = clamp(0.0, this.volume, from + (elapsed * step))
const baseVolume = clamp(0.0, this.volume, from + (elapsed * step))
this.audio.volume = baseVolume * replayGainFactor
this.handle = setTimeout(run, 10)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw. I don't think the fade will be correct now.. It may fade in too fast since replayGainFactor isn't induced in the step size

@tamland tamland merged commit 5564317 into tamland:master Dec 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants