Skip to main content

Mixing

About Audio Mixing

Audio signal mixing is the process of combining multiple audio signals into a single output. This is commonly done in music production, live sound reinforcement, and broadcasting. The goal of mixing is to create a balanced and cohesive sound that enhances the overall listening experience. Mixing involves adjusting the levels, panning, and equalization of each individual signal to create a harmonious blend.

Code Example

This example loads two mp3 audio files and mixes them together using the MixerNode. The two GainNode instances can be used to control the volume of the individual audio players.

{
"nodes": {
{ "id": "drumsPlayerNode", "type": "AudioPlayerNode" },
{ "id": "drumsGainNode", "type": "GainNode" },
{ "id": "bassPlayerNode", "type": "AudioPlayerNode" },
{ "id": "bassGainNode", "type": "GainNode" },
{ "id": "mixerNode", "type": "MixerNode" }
},
"connections": {
{ "sourceNode": "drumsPlayerNode", "destinationNode": "drumsGainNode" },
{ "sourceNode": "bassPlayerNode", "destinationNode": "bassGainNode" },
{ "sourceNode": "drumsGainNode", "destinationNode": "mixerNode" },
{ "sourceNode": "bassGainNode", "destinationNode": "mixerNode" },
{ "sourceNode": "mixerNode", "destinationNode": "outputNode" }
},
"tracks": {
"drumsPlayerNode": "drums.mp3",
"bassPlayerNode": "bass.mp3"
}
}

Please note that the two audio players are not guaranteed to be precisely aligned in time. Please check out our Synchronized Audio Players example to see how to create synchronized audio players.