Constructor
new AudioEffect(mixopt)
Create an audio effect
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
mix | number | <optional> | 1 | Wet/dry balance, 0 is fully dry and 1 is fully wet |
- Source
const cave = new AudioReverb(3, 2);
footstep.output = cave; // every play of this sound is in the caveMembers
dryGain
Properties| Type | Description |
|---|---|
| GainNode | Level of the unprocessed signal |
- Source
input
Properties| Type | Description |
|---|---|
| GainNode | Connect sounds to this node |
- Source
mix
Properties| Type | Description |
|---|---|
| number | Wet/dry balance, 0 is fully dry and 1 is fully wet |
- Source
output
Properties| Type | Description |
|---|---|
| GainNode | This node carries the mixed result, send it somewhere with connect(), never by assigning here
|
- Source
wetGain
Properties| Type | Description |
|---|---|
| GainNode | Level of the processed signal |
- Source
Methods
connect(target) → {AudioEffect|AudioNode}
Send this effect's output into another effect or audio node instead of the speakers
| Name | Type | Description |
|---|---|---|
target | AudioEffect | | The next effect in the chain, or any audio node |
- Source
- The target, so chains read left to right
- Type:
- AudioEffect |
AudioNode
(protected) connectEffect(first, lastopt)
Wire nodes between the input and the wet gain, for subclasses
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
first | AudioNode | Node the input connects to | ||
last | AudioNode | <optional> | first | Node that connects to the wet gain |
- Source
disconnect()
Stop sending this effect's output anywhere
- Source
(protected) rampParam(param, value, fadeTimeopt)
Ramp one of this effect's params, keeping the effect running until the ramp is done
- The browser drops an effect from rendering while nothing plays through it, which would freeze a ramp partway, so a silent source feeds the input for the ramp's length
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
param | AudioParam | The param to ramp | ||
value | number | Where to ramp to | ||
fadeTime | number | <optional> | 0 | Seconds to ramp over, 0 sets the value at once |
- Source
setMix(mix, fadeTimeopt)
Set the wet/dry balance
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
mix | number | 0 is fully dry and 1 is fully wet | ||
fadeTime | number | <optional> | 0 | Seconds to ramp over so the change doesn't click |
- Source