Isolate output of right channel or left channel of audio blob using a panner (Javascript)
To isolate a channel of a signal with the Web Audio API you could use the ChannelSplitterNode
which allows you to connect the individual channels of a signal separately.
A simple example to isolate the left channel (channel at index 0) from a stereo signal might look like this:
const channelSplitterNode = new ChannelSplitterNode(
audioContext,
{ numberOfOutputs: 2 }
);
input
.connect(channelSplitterNode)
.connect(output, 0);
Jordan Eldredge once wrote a nice article which explains the difference between the StereoPannerNode
and what he calls a StereoBalanceNode
. Implementing a Robust Web Audio API Balance Node
Read more here: Source link