Skip to main content
Version: 0.4.0

Source Properties

You can do a lot more with the sources than just position them. The most common thing you might want to to is set their overal gain without the need to re-export them from your sound design project. Some sources could use some more reverb than others, and for some you might have a different distance to loudness behavior in mind!

Controlling the gain

You can control the overal gain of a source either linearily or in decibels using its gain setter methods:

source.setGainLinear(2)
// or in decibels
source.setGainDecibels(6.02059991)

// forgot the gain you've set them?
const value = source.getGainLinear();
const valuedB = source.getGainDecibels();

Setting the reverb send level

Per default, sources don't contribute to the reverb effect. But you can change that by setting their reverb send level:

source.setReverbSendLinear(0.7)
// or in decibels
source.setReverbSendDecibels(-3.0980392)

// guess what? there's a getter as well!
const value = source.getReverbSendLinear()
const valuedB = source.getReverbSendDecibels()

Assign an Attenuation Curve

In combination with reverb, attenuation curves are the best way to simulate distance. See also attenuation curves

Occlusion/Obstruction

If you want to create the feeling that a bigger object sits between a source and the listener, you can increase the occlusion value of a source. This will dampen the audio signal and redude its volume, simulating occlusion/obstruction.

The occlusion value has to be in the range [0.0; 0.1], with 0.0 no occlusion happening and 1.0 full occlusion.

source.setOcclusion(0.7)
const value = source.getOcclusion()