[Audio] Headroom tweak

This commit is contained in:
maikirakiwi 2022-04-08 15:32:50 -07:00
parent 95e25c5a24
commit a61f767748
2 changed files with 3 additions and 2 deletions

View file

@ -185,6 +185,7 @@ const CiderAudio = {
} }
if (maxGain == -120) {maxGain = 1} if (maxGain == -120) {maxGain = 1}
if (CiderAudio.audioNodes.llpw !== null && CiderAudio.audioNodes.llpw.length == 1) {maxGain = maxGain * 1.109174815262401} if (CiderAudio.audioNodes.llpw !== null && CiderAudio.audioNodes.llpw.length == 1) {maxGain = maxGain * 1.109174815262401}
if (CiderAudio.audioNodes.atmosphereRealizer !== null) {maxGain = maxGain * 1.17489755493953}
if (app.cfg.audio.maikiwiAudio.spatial === true) { if (app.cfg.audio.maikiwiAudio.spatial === true) {
let spatialProfile = CiderAudio.spatialProfiles.find(function (profile) { let spatialProfile = CiderAudio.spatialProfiles.find(function (profile) {
return profile.id === app.cfg.audio.maikiwiAudio.spatialProfile; return profile.id === app.cfg.audio.maikiwiAudio.spatialProfile;

View file

@ -775,8 +775,8 @@ const app = new Vue({
} }
numbers.shift() numbers.shift()
let peak = Math.max(numbers[6], numbers[7]) / 32768.0 let peak = Math.max(numbers[6], numbers[7]) / 32768.0
let gain = Math.pow(10, ((-1 - (Math.log10(peak) * 20)) / 20))// EBU R 128 Compliant let gain = Math.pow(10, ((-0.8 - (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`) console.debug(`[Cider][MaikiwiSoundCheck] Peak Gain: '${(Math.log10(peak) * 20).toFixed(2)}' dB | Adjusting '${(Math.log10(gain) * 20).toFixed(2) - 0.2}' dB`)
try { try {
//CiderAudio.audioNodes.gainNode.gain.value = (Math.min(Math.pow(10, (replaygain.gain / 20)), (1 / replaygain.peak))) //CiderAudio.audioNodes.gainNode.gain.value = (Math.min(Math.pow(10, (replaygain.gain / 20)), (1 / replaygain.peak)))
CiderAudio.audioNodes.gainNode.gain.value = gain CiderAudio.audioNodes.gainNode.gain.value = gain