我试图通过范围输入在运行时更改一个值,但我没有让它工作。我没有错误。当我在 onSlide 中更改频率时,声音仍然会在 800 上播放。它应该会改变。
import $ from 'jquery';
import rangeslider from 'rangeslider.js';
import T from 'timbre';
window.$ = $;
$(document).ready(() => {
var f = 800;
T("sin", {freq:f, mul:0.5}).play(); /*plays a continous sound*/
$('input[type="range"]').rangeslider({
polyfill : false,
onSlide: function() {
var ff = 440; /*changing frequancy, but the tone is still the same.*/
f = ff;
}
});
});