Skip to content

Commit

Permalink
Merge pull request #144 from sentriz/rg-fix
Browse files Browse the repository at this point in the history
ReplayGain: make sure volume doesn't exceed 1.0
  • Loading branch information
tamland authored Jan 20, 2025
2 parents e483434 + 8924013 commit 231396e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/player/audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class AudioController {
return
}
const elapsed = Date.now() - startTime
this.audio.volume = clamp(0.0, Math.max(from, to), from + (elapsed * step))
this.audio.volume = clamp(0.0, Math.min(Math.max(from, to), 1), from + (elapsed * step))
this.handle = setTimeout(run, 10)
}
run()
Expand Down

0 comments on commit 231396e

Please sign in to comment.