The ConvolverNode interface is an AudioNode that performs a Linear Convolution on a given AudioBuffer, often used to achieve a reverb effect. A ConvolverNode always has exactly one input and one output.
Note: For more information on the theory behind Linear Convolution, see the Convolution article on Wikipedia.
| Number of inputs | 1 |
|---|---|
| Number of outputs | 1 |
| Channel count mode | "clamped-max" |
| Channel count | 1, 2, or 4 |
| Channel interpretation | "speakers" |
Constructor
ConvolverNode()- Creates a new
ConvolverNodeobject instance.
Properties
Inherits properties from its parent, AudioNode.
ConvolverNode.buffer- A mono, stereo, or 4-channel
AudioBuffercontaining the (possibly multichannel) impulse response used by theConvolverNodeto create the reverb effect. ConvolverNode.normalize- A boolean that controls whether the impulse response from the buffer will be scaled by an equal-power normalization when the
bufferattribute is set, or not.
Methods
No specific method; inherits methods from its parent, AudioNode.
ConvolverNode Example
The following example shows basic usage of an AudioContext to create a convolver node.
Note: You will need to find an impulse response to complete the example below. See this Codepen for an applied example.
let audioCtx = new window.AudioContext();
async function createReverb() {
let convolver = audioCtx.createConvolver();
// load impulse response from file
let response = await fetch("path/to/impulse-response.wav");
let arraybuffer = await response.arrayBuffer();
convolver.buffer = await audioCtx.decodeAudioData(arraybuffer);
return convolver;
}
...
let reverb = await createReverb();
// someOtherAudioNode -> reverb -> destination
someOtherAudioNode.connect(reverb);
reverb.connect(audioCtx.destination);
Specifications
| Specification | Status | Comment |
|---|---|---|
| Web Audio API The definition of 'ConvolverNode' in that specification. |
Working Draft |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
ConvolverNode | Chrome Full support 14 | Edge Full support ≤18 | Firefox Full support 25 | IE No support No | Opera Full support 15 | Safari Full support 6 | WebView Android Full support Yes | Chrome Android Full support 18 | Firefox Android Full support 26 | Opera Android Full support 14 | Safari iOS Full support Yes | Samsung Internet Android Full support 1.0 |
ConvolverNode() constructor | Chrome Full support 55 | Edge Full support ≤79 | Firefox Full support 53 | IE No support No | Opera Full support 42 | Safari ? | WebView Android Full support 55 | Chrome Android Full support 55 | Firefox Android Full support 53 | Opera Android Full support 42 | Safari iOS ? | Samsung Internet Android Full support 6.0 |
buffer | Chrome Full support 14 | Edge Full support 12 | Firefox Full support 25 | IE No support No | Opera Full support 15 | Safari Full support 6 | WebView Android Full support Yes | Chrome Android Full support 18 | Firefox Android Full support 26 | Opera Android Full support 14 | Safari iOS Full support Yes | Samsung Internet Android Full support 1.0 |
normalize | Chrome Full support 14 | Edge Full support 12 | Firefox Full support 25 | IE No support No | Opera Full support 15 | Safari Full support 6 | WebView Android Full support Yes | Chrome Android Full support 18 | Firefox Android Full support 26 | Opera Android Full support 14 | Safari iOS Full support Yes | Samsung Internet Android Full support 1.0 |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
