WaveShaperNode
The WaveShaperNode interface represents non-linear signal distortion effects.
Non-linear distortion is commonly used for both subtle non-linear warming, or more obvious distortion effects.
AudioNode properties
| Number of inputs | 1 |
| Number of outputs | 1 |
| Channel count | 2 |
| Channel count mode | clamped-max |
| Channel interpretation | speakers |
Constructor
BaseAudioContext.createWaveShaper()
Properties
It inherits all properties from AudioNode.
| Name | Type | Description |
|---|---|---|
curve | Float32Array | null | The shaping curve used for waveshaping effect. |
oversample | OverSampleType | Specifies what type of oversampling should be used when applying shaping curve. |
Methods
WaveShaperNode does not define any additional methods.
It inherits all methods from AudioNode.
Remarks
curve
- Default value is null
- Contains at least two values.
- Subsequent modifications of curve have no effects. To change the curve, assign a new Float32Array object to this property.
oversample
- Default value
none - Value of
2xor4xcan increases quality of the effect, but in some cases it is better not to use oversampling for very accurate shaping curve.
OverSampleType
Type definitions
// Do not oversample | Oversample two times | Oversample four times
type OverSampleType = 'none' | '2x' | '4x';