Skip to content

Commit 7127671

Browse files
committed
use pow for volume
1 parent 2dbb085 commit 7127671

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

editor/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ async function main() {
273273
});
274274
controls.appendChild(sampleRateElem);
275275

276-
const volumeElem = addVerticalRange({min: 1, max: 100, step: 1, value: g_localSettings.volume }, {
276+
const volumeElem = addVerticalRange({min: 0, max: 100, step: 1, value: g_localSettings.volume }, {
277277
onChange(event) {
278-
g_gainNode.gain.value = event.target.value / 100;
278+
g_gainNode.gain.value = Math.pow(event.target.value / 100, 2);
279279
g_localSettings.volume = parseInt(event.target.value);
280280
saveSettings();
281281
},
@@ -486,6 +486,7 @@ async function main() {
486486
g_byteBeat.setType(parseInt(t));
487487
g_byteBeat.setExpressionType(parseInt(e));
488488
g_byteBeat.setDesiredSampleRate(parseInt(s));
489+
g_byteBeat.reset();
489490
if (data.v) {
490491
setVisualizerByName(data.v);
491492
}

0 commit comments

Comments
 (0)