@@ -23,7 +23,6 @@ export class AudioController {
23
23
private statsListener : any = null
24
24
private replayGainMode = ReplayGainMode . None
25
25
private replayGain : ReplayGain | null = null
26
- private preAmp = 0.0
27
26
28
27
ontimeupdate : ( value : number ) => void = ( ) => { /* do nothing */ }
29
28
ondurationchange : ( value : number ) => void = ( ) => { /* do nothing */ }
@@ -181,14 +180,9 @@ export class AudioController {
181
180
}
182
181
183
182
private replayGainFactor ( ) : number {
184
- if ( this . replayGainMode === ReplayGainMode . None ) {
183
+ if ( this . replayGainMode === ReplayGainMode . None || ! this . replayGain ) {
185
184
return 1.0
186
185
}
187
- if ( ! this . replayGain ) {
188
- console . warn ( 'AudioController: no ReplayGain information' )
189
- return 1.0
190
- }
191
-
192
186
const gain = this . replayGainMode === ReplayGainMode . Track
193
187
? this . replayGain . trackGain
194
188
: this . replayGain . albumGain
@@ -204,7 +198,8 @@ export class AudioController {
204
198
205
199
// Implementing min(10^((RG + Gpre-amp)/20), 1/peakamplitude)
206
200
// https://wiki.hydrogenaud.io/index.php?title=ReplayGain_2.0_specification
207
- const gainFactor = Math . pow ( 10 , ( gain + this . preAmp ) / 20 )
201
+ const preAmp = 0.0
202
+ const gainFactor = Math . pow ( 10 , ( gain + preAmp ) / 20 )
208
203
const peakFactor = 1 / peak
209
204
const factor = Math . min ( gainFactor , peakFactor )
210
205
0 commit comments