From 6251584ef68d34e418d50d647b73da7ce7b0e4f2 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 15 Jun 2021 23:37:44 +0000 Subject: [PATCH] fix .13dB clipping with all-zero eq --- copyparty/web/browser.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 82761521..995c4eba 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -643,7 +643,11 @@ var audio_eq = (function () { for (var a = r.filters.length - 1; a >= 0; a--) { r.filters[a].connect(a > 0 ? r.filters[a - 1] : mp.ac.destination); } - mp.acs.connect(r.filters[r.filters.length - 1]); + fi = mp.ac.createGain(); + fi.gain.value = '0.94'; // +.137 dB measured; now -.25 dB and almost bitperfect + mp.acs.connect(fi); + fi.connect(r.filters[r.filters.length - 1]); + r.filters.push(fi); } function eq_step(e) { @@ -697,8 +701,7 @@ var audio_eq = (function () { h4.push(''); h3.push(''); } - html.push(''); - html = html.join('\n'); + html = html.join('\n') + ''; html += h2.join('\n') + ''; html += h3.join('\n') + ''; html += h4.join('\n') + '';