Unsere Freiwilligen haben diesen Artikel noch nicht in Deutsch übersetzt. Machen Sie mit und helfen Sie, das zu erledigen!
Sie können den Artikel auch auf English (US) lesen.

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 ConvolverNode object instance.

Properties

Inherits properties from its parent, AudioNode.

ConvolverNode.buffer
A mono, stereo, or 4-channel AudioBuffer containing the (possibly multichannel) impulse response used by the ConvolverNode to 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 buffer attribute 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.

 

var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var reverb = audioCtx.createConvolver();
...

function base64ToArrayBuffer(base64) {
    var binaryString = window.atob(base64);
    var len = binaryString.length;
    var bytes = new Uint8Array(len);
    for (var i = 0; i < len; i++)        {
        bytes[i] = binaryString.charCodeAt(i);
    }
    return bytes.buffer;
}

...

var reverbSoundArrayBuffer = base64ToArrayBuffer(impulseResponse);
audioCtx.decodeAudioData(reverbSoundArrayBuffer, function(buffer) {
  reverb.buffer = buffer;
},
function(e) {
  alert('Error when decoding audio data ' + e.err);
})

 

Specifications

Specification Status Comment
Web Audio API
The definition of 'ConvolverNode' in that specification.
Working Draft  

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 14Edge Full support YesFirefox Full support 25IE No support NoOpera Full support 15Safari Full support 6WebView Android Full support YesChrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 26Opera Android Full support 15Safari iOS ? Samsung Internet Android Full support Yes
ConvolverNode() constructorChrome Full support 55Edge ? Firefox Full support 53IE No support NoOpera Full support 42Safari ? WebView Android Full support 55Chrome Android Full support 55Edge Mobile ? Firefox Android Full support 53Opera Android Full support 42Safari iOS ? Samsung Internet Android Full support 6.0
bufferChrome Full support 14Edge Full support 12Firefox Full support 25IE No support NoOpera Full support 15Safari Full support 6WebView Android Full support YesChrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 26Opera Android Full support 15Safari iOS ? Samsung Internet Android Full support Yes
normalizeChrome Full support 14Edge Full support 12Firefox Full support 25IE No support NoOpera Full support 15Safari Full support 6WebView Android Full support YesChrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 26Opera Android Full support 15Safari iOS ? Samsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also

Schlagwörter des Dokuments und Mitwirkende

Zuletzt aktualisiert von: rssilva,