Skip to content

Commit 231396e

Browse files
authored
Merge pull request #144 from sentriz/rg-fix
ReplayGain: make sure volume doesn't exceed 1.0
2 parents e483434 + 8924013 commit 231396e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/player/audio.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export class AudioController {
172172
return
173173
}
174174
const elapsed = Date.now() - startTime
175-
this.audio.volume = clamp(0.0, Math.max(from, to), from + (elapsed * step))
175+
this.audio.volume = clamp(0.0, Math.min(Math.max(from, to), 1), from + (elapsed * step))
176176
this.handle = setTimeout(run, 10)
177177
}
178178
run()

0 commit comments

Comments
 (0)