Skip to content

ChannelMergerNode

Hans Lindetorp edited this page Apr 7, 2022 · 2 revisions

The ChannelMergerNode is useful if you want to merge multiple audio streams into one multichannel stream (e.g. left and right). The child nodes are targeted in index order to each output channel in the system. If there are more child nodes than output channels on the current sound card, the audio signal will be connected to the target output index % number of audio channels.

attributes:

  • pan (-1 to 1)
  • crossfade (0 to 1)

The crossfade attribute makes it possible to crossfade the volume between the child elements.

The simple example below shows how two monofiles can be merged into one output each (e.g. left and right).

<Mixer>
  <ChannelMergerNode>
    <AudioBufferSourceNode src="mono-file-1.mp3" />
    <AudioBufferSourceNode src="mono-file-2.mp3" />
  </ChannelMergerNode>
</Mixer>

Read more: https://developer.mozilla.org/en-US/docs/Web/API/ChannelMergerNode

Clone this wiki locally