I'm playing around with the web audio context and trying to understand how the splitter node works.
I've managed to split an oscillator node and connect it to output only to the left/right channels, but I'm having some hard time outputting it to the "center" channel alone...
given the following code
const ac = new AudioContext();
const splitter = ac.createChannelSplitter(6);
const oscilator = ac.createOscillator();
const merger = ac.createChannelMerger(6);
oscilator.frequency.value = 440;
const gainNode = ac.createGain();
// connect oscilator to splitter channel
oscilator.connect(splitter);
gainNode.gain.setValueAtTime(0.5, ac.currentTime);
splitter.connect(gainNode, 0);
gainNode.connect(merger, 0, 2);
merger.connect(ac.destination);
oscilator.start(0);
oscilator.stop(1);
I expect the oscillator tune to be outputted only in my "center" speaker, but I hear the sound from both.
what am I missing?