Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web Audio API: How do I play a mono source in only left or right channel?

Is there an (easy) way to take a mono input and play it only in the left or right channel? I'm thinking I can do it through the ScriptProcessing node, but if there is a node meant to handle this situation I'd really like to know. The API has a section on mixing, but I don't see any code on how to manipulate channels yourself in this fashion.

Note, I have tried the panner node, but it doesn't seem to really cut off the left the from the right channel, I don't want any sound bleeding from one channel to the other.

like image 820
Cole Reed Avatar asked Jan 31 '13 10:01

Cole Reed


1 Answers

You do want to use the ChannelSplitter, although there is a bug when a channel is simply not connected. See this issue: Play an Oscillation In a Single Channel.

like image 107
cwilso Avatar answered Jun 27 '23 12:06

cwilso