javascript - web audio api: multiply waves -
the web audio api lets me create constant sine wave in specified frequence signal this:
var actx = new audiocontext(); var osc = actx.createoscillator(); osc.frequency.value = 500; osc.connect(actx.destination); osc.start();
how can multiply wave wave in order "shape" it. example how multiply sine wave of 200 hz.
like so:
try like
var osc1 = context.createoscillator(); var osc2 = context.createoscillator(); var gain = context.creategain(); osc1.frequency.value = 500; osc2.frequency.value = 20; osc1.connect(gain); osc2.connect(gain.gain); gain.connect(context.destination); osc1.start(); osc2.start();
Comments
Post a Comment