This page is work-in-progress. You can reach me on twitter or mail to rezoner1337@gmail.com

Channel

Instance of SoundOnDemand.Channel - imagine it as a tube that sound has to get through. This tube makes the sound audible and modifies its properies such as volume or reverberation.

Create channels

Channels can be created by an instance of SoundOnDemand

this.audio = new SoundOnDemand();

/* you can create as many channels as you need */

this.gui = this.audio.channel("gui");
this.game = this.audio.channel("game");
this.music = this.audio.channel("music");

Volume

Adjust volume of a channel.

this.music.volume(0.5);

Convolver

Mix any sound that gets through a tube with an impulse response. It's mostly used to create a reverb effect

channel.convolver(amount, impulse);

Example:

channel.convolver(0.5, "reverbs/cave");

And when you've already picked some impulse you can change just amount:

channel.convolver(0.25);

Impulse response is just an audio file. In this case reverbs/cave.ogg

You can get a lot of free impulse responses in OpenAir project

A brief explanation of impulse responses and convolution

Clap your hands. Sound will propagate, get bounced of the walls and come back to your ear. If you were standing in a cave you would hear significant echo and reverb as some of this sound gets back to your ear earlier while the rest have to hit distant walls.

If you could record that clap - you would get what we call an impulse response - a three dimensional image of sound propagation in an environment. Imagine it as a raycasting for sound.

Then you could mix this response with another sound to reproduce the original environment of the impulse through a process called convolution wgucg we use it to simulate variety range of reverbs and environements including caves, forest or a guy talking through a telephone.

Ask question:

Fork me on GitHub