ConvolverNode interface is an AudioNode that performs a Linear Convolution on a given AudioBuffer , often used to achieve a reverb effect. A ConvolverNode 总是准确拥有一个输入和一个输出。

注意 : For more information on the theory behind Linear Convolution, see the Convolution article on Wikipedia .

输入数 1
输出数 1
通道计数模式 "clamped-max"
通道计数 1 , 2 ,或 4
通道解释 "speakers"

构造函数

ConvolverNode()
创建新的 ConvolverNode 对象实例。

特性

继承的特性来自其父级, 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.

方法

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.

注意 : 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);
					

规范

规范 状态 注释
Web 音频 API
The definition of 'ConvolverNode' in that specification.
工作草案

浏览器兼容性

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. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
ConvolverNode Chrome 14 Edge ≤18 Firefox 25 IE 不支持 No Opera 15 Safari 6 WebView Android Yes Chrome Android 18 Firefox Android 26 Opera Android 14 Safari iOS Yes Samsung Internet Android 1.0
ConvolverNode() 构造函数 Chrome 55 Edge ≤79 Firefox 53 IE 不支持 No Opera 42 Safari ? WebView Android 55 Chrome Android 55 Firefox Android 53 Opera Android 42 Safari iOS ? Samsung Internet Android 6.0
buffer Chrome 14 Edge 12 Firefox 25 IE 不支持 No Opera 15 Safari 6 WebView Android Yes Chrome Android 18 Firefox Android 26 Opera Android 14 Safari iOS Yes Samsung Internet Android 1.0
normalize Chrome 14 Edge 12 Firefox 25 IE 不支持 No Opera 15 Safari 6 WebView Android Yes Chrome Android 18 Firefox Android 26 Opera Android 14 Safari iOS Yes Samsung Internet Android 1.0

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

另请参阅

元数据

  • 最后修改: