Add options for album gain
This commit is contained in:
parent
edb1c8867a
commit
4dcb0fa658
4 changed files with 22 additions and 10 deletions
|
@ -112,9 +112,12 @@ class HtmlAudioPlayer {
|
|||
let val = options.url;
|
||||
console.debug('playing url: ' + val);
|
||||
import('../../scripts/settings/userSettings').then((userSettings) => {
|
||||
if (userSettings.enableAudioNormalization() && options.item.LUFS != null) {
|
||||
if (userSettings.udioNormalization() == "TrackGain" && options.item.LUFS != null) {
|
||||
const dbGain = -18 - options.item.LUFS;
|
||||
self.gainNode.gain.value = Math.pow(10, (dbGain / 20));
|
||||
} else if (userSettings.AudioNormalization == "AlbumGain" && options.item.LUFSAlbum != null) {
|
||||
const dbGain = -18 - options.item.LUFSAlbum;
|
||||
self.gainNode.gain.value = Math.pow(10, (dbGain / 20));
|
||||
} else {
|
||||
self.gainNode.gain.value = 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue