GainNode
The GainNode
interface represents the change in volume (amplitude) of the audio signal.
It is an AudioNode
that applies given gain to processing audio data.
Direct gain modification often results in unpleasant 'clicks'. To avoid this effect, utilize exponential interpolation methods from the AudioParam
.
AudioNode
properties
Number of inputs | 1 |
Number of outputs | 1 |
Channel count | 2 |
Channel count mode | max |
Channel interpretation | speakers |
Envelope - ADSR
Envelope is term widely used in music and sound engineering, it describes how a sound changes over time. The most common way of describing an envelope is ADSR. This acronym stands for: attack, decay, sustain and release.
- Attack - the time it takes for the sound to reach its peak volume from the beginning.
- Decay - the time it takes for the sound to reach the sustain level after the peak volume.
- Sustain - the volume level that the sound will stay at until the key is released.
- Release - the time it takes for the sound to fade out after the key is released.
You can read more about envelopes and ADSR on Wikipedia.
Constructor
Properties
Name | Type | Description | |
---|---|---|---|
gain | AudioParam | a-rate AudioParam representing value of gain to apply. | Read only |
Remarks
gain
- Default value is 1.0.
- Nominal range is -∞ to ∞.