javascript - Web Audio: No sound in right channel -



javascript - Web Audio: No sound in right channel -

i'm trying create custom panning command using web sound api, can't sound come out of right channel using channel splitter , merger nodes:

var context = new webkitaudiocontext(), destination = context.destination, osc = context.createoscillator(), gainl = context.creategainnode(), gainr = context.creategainnode(), splitter = context.createchannelsplitter(2), merger = context.createchannelmerger(2); osc.frequency.value = 500; osc.connect(splitter); splitter.connect(gainl, 0); splitter.connect(gainr, 1); gainl.connect(merger, 0, 0); gainr.connect(merger, 0, 1); osc.noteon(0); gainl.gain.value = 0.1; gainr.gain.value = 0.5; osc.noteoff(2); merger.connect(destination);

am missing obvious here? there's jsbin preview of above code here: http://jsbin.com/ayijoy/1/

i'm running chrome v24.0.1312.57, in case that's of use.

my best guess happens because oscillator outputs mono signal. seek using stereo source , should have more luck.

edit: here's how can pan "mono" signal (bypass splitter, since there no stereo signal split, , connect oscillator straight 2 gains. connect 2 mono signals merger after adjusting gain each channel) http://jsbin.com/ayijoy/16/

javascript html5 web-audio

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -