Merge pull request #1215 from eminence/webaudio_fix

Fix webaudio example
This commit is contained in:
Alex Crichton 2019-01-29 09:04:56 -06:00 committed by GitHub
commit 5fbcad48d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,21 +19,21 @@ import('./pkg/webaudio')
const primary_slider = document.getElementById("primary_input");
primary_slider.addEventListener("input", event => {
if (fm) {
fm.set_note(event.target.value);
fm.set_note(parseInt(event.target.value));
}
});
const fm_freq = document.getElementById("fm_freq");
fm_freq.addEventListener("input", event => {
if (fm) {
fm.set_fm_frequency(event.target.value);
fm.set_fm_frequency(parseFloat(event.target.value));
}
});
const fm_amount = document.getElementById("fm_amount");
fm_amount.addEventListener("input", event => {
if (fm) {
fm.set_fm_amount(event.target.value);
fm.set_fm_amount(parseFloat(event.target.value));
}
});
})