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:

enter image description here

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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -