[Audio] IntelliGainComp

This commit is contained in:
maikirakiwi 2022-04-03 14:18:36 -07:00
parent 5432158108
commit a81aeb4da9
3 changed files with 493 additions and 457 deletions

View file

@ -773,8 +773,8 @@ const app = new Vue({
}
numbers.shift()
let peak = Math.max(numbers[6], numbers[7]) / 32768.0
let gain = Math.pow(10, ((-7.63 - (Math.log10(peak) * 20)) / 20))// EBU R 128 Compliant
console.debug(`[Cider][MaikiwiSoundCheck] Peak Gain: '${Math.log10(peak) * 20}' dB | Adjusting '${Math.log10(gain) * 20}' dB`)
let gain = Math.pow(10, ((-2 - (Math.log10(peak) * 20)) / 20))// EBU R 128 Compliant
console.debug(`[Cider][MaikiwiSoundCheck] Peak Gain: '${(Math.log10(peak) * 20).toFixed(2)}' dB | Adjusting '${(Math.log10(gain) * 20).toFixed(2)}' dB`)
try {
//CiderAudio.audioNodes.gainNode.gain.value = (Math.min(Math.pow(10, (replaygain.gain / 20)), (1 / replaygain.peak)))
CiderAudio.audioNodes.gainNode.gain.value = gain
@ -3857,23 +3857,6 @@ const app = new Vue({
element.onclick = app.LastFMDeauthorize;
});
},
/**
parseSCTagToRG: function (tag) {
let soundcheck = tag.split(" ")
let numbers = []
for (item of soundcheck) {
numbers.push(parseInt(item, 16))
}
numbers.shift()
//let gain = Math.log10((Math.max(numbers[0], numbers[1]) ?? 1000) / 1000.0) * -10
let peak = Math.max(numbers[6], numbers[7]) / 32768.0
let gain = Math.pow(10, ((-7.63 - (Math.log10(peak) * 20)) / 20))// EBU R 128 Compliant
return {
gain: gain,
peak: peak
}
},*/
fullscreen(flag) {
if (flag) {
ipcRenderer.send('setFullScreen', true);