AudioBed
Summary
Interface for audio bed signals.⚠️
Do not construct an AudioBed yourself, it will be created by the renderer.
Methods
getGainDecibels
Returns the currently set gain in decibels.
Signature
getGainDecibels()
Returns
number
The current gain in decibels.getGainLinear
Returns the currently set gain as a linear value.
Signature
getGainLinear()
Returns
number
The current linear gain.getHeadlocked
Returns the current headlocked-mode.
Signature
getHeadlocked()
Returns
boolean
true if headlocked-mode is activated.removeInput
Disconnects an audionode from the audio bed input.
Signature
removeInput(node: AudioNode, outputIndex?: number)
Name | Type | Description |
---|---|---|
node | AudioNode | node to disconnect |
outputIndex optional | number | index of the node's output bus which should be disconnected |
Returns
void
⚠️
Make sure this AudioNode has been previously connected to the AudioBed.
setGainDecibels
Sets the gain in decibels.
Signature
setGainDecibels(dB: number)
Name | Type | Description |
---|---|---|
dB | number | The gain in decibels to apply. |
Returns
void
setGainLinear
Sets gain from a linear value.
Signature
setGainLinear(gain: number)
Name | Type | Description |
---|---|---|
gain | number | The linear gain to apply. |
Returns
void
setHeadlocked
Sets the audio bed headlocked, making its rendering unaffected by the listener's
orientation.
Signature
setHeadlocked(shouldBeHeadlocked: boolean)
Name | Type | Description |
---|---|---|
shouldBeHeadlocked | boolean | set true to enable headlocked-mode |
Returns
void
setInput
Connects an audionode to the audio bed input.
Signature
setInput(node: AudioNode, outputIndex?: number)
Name | Type | Description |
---|---|---|
node | AudioNode | audio node to be connected |
outputIndex optional | number | index of the node's output bus which should be connected |
Returns
void
💡
You can connect multiple audio nodes by calling connect several times.