IIRFilterNode
接口在
Web 音频 API
是
AudioNode
processor which implements a general
infinite impulse response
(IIR) filter; this type of filter can be used to implement tone control devices and graphic equalizers as well. It lets the parameters of the filter response be specified, so that it can be tuned as needed.
| 输入数 |
1
|
|---|---|
| 输出数 |
1
|
| 通道计数模式 |
"max"
|
| 通道计数 | 如同输入 |
| 通道解释 |
"speakers"
|
Typically, it's best to use the
BiquadFilterNode
interface to implement higher-order filters. There are several reasons why:
BiquadFilterNode
.
However, if you need to create an odd-ordered IIR filter, you'll need to use
IIRFilterNode
. You may also find this interface useful if you don't need automation, or for other reasons.
Once the node has been created, you can't change its coefficients.
IIRFilterNode
s have a tail-time reference; they continue to output non-silent audio with zero input. As an IIR filter, the non-zero input continues forever, but this can be limited after some finite time in practice, when the output has approached zero closely enough. The actual time that takes depends on the filter coefficients provided.
IIRFilterNode()
Creates a new instance of an IIRFilterNode object.
This interface has no properties of its own; however, it inherits properties from its parent,
AudioNode
.
继承方法来自其父级
AudioNode
. It also has the following additional methods:
getFrequencyResponse()
Uses the filter's current parameter settings to calculate the response for frequencies specified in the provided array of frequencies.
You can find a simple IIR filter demo live
on Codepen
. Also see the
source code on GitHub
. It includes some different coefficient values for different lowpass frequencies — you can change the value of the
filterNumber
constant to a value between 0 and 3 to check out the different available effects.
Also see our Using IIR filters guide for a full explanation.
| 规范 | 状态 | 注释 |
|---|---|---|
|
Web 音频 API
The definition of 'IIRFilterNode' in that specification. |
工作草案 | Initial Definition |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
IIRFilterNode
|
Chrome 49 | Edge ≤18 | Firefox 50 | IE 不支持 No | Opera 36 | Safari ? | WebView Android 49 | Chrome Android 49 | Firefox Android 50 | Opera Android 36 | Safari iOS ? | Samsung Internet Android 5.0 |
IIRFilterNode()
构造函数
|
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
注意事项
|
getFrequencyResponse
|
Chrome 49 | Edge 14 | Firefox 50 | IE 不支持 No | Opera 36 | Safari ? | WebView Android 49 | Chrome Android 49 | Firefox Android 50 | Opera Android 36 | Safari iOS ? | Samsung Internet Android 5.0 |
完整支持
不支持
兼容性未知
见实现注意事项。
IIRFilterNode
AnalyserNode
AudioBuffer
AudioBufferSourceNode
AudioContext
AudioContextOptions
AudioDestinationNode
AudioListener
AudioNode
AudioNodeOptions
AudioParam
AudioProcessingEvent
AudioScheduledSourceNode
AudioWorklet
AudioWorkletGlobalScope
AudioWorkletNode
AudioWorkletProcessor
BaseAudioContext
BiquadFilterNode
ChannelMergerNode
ChannelSplitterNode
ConstantSourceNode
ConvolverNode
DelayNode
DynamicsCompressorNode
GainNode
MediaElementAudioSourceNode
MediaStreamAudioDestinationNode
MediaStreamAudioSourceNode
OfflineAudioCompletionEvent
OfflineAudioContext
OscillatorNode
PannerNode
PeriodicWave
StereoPannerNode
WaveShaperNode