BiquadFilterNode
接口表示简单低阶过滤器,且创建是使用
AudioContext.createBiquadFilter()
方法。它是
AudioNode
可以表示不同种类的过滤器、色调控制设备及图形均衡器。
A
BiquadFilterNode
总是准确拥有一个输入和一个输出。
| 输入数 |
1
|
|---|---|
| 输出数 |
1
|
| 通道计数模式 |
"max"
|
| 通道计数 |
2
(不用于默认计数模式)
|
| 通道解释 |
"speakers"
|
BiquadFilterNode()
BiquadFilterNode
对象。
继承的特性来自其父级,
AudioNode
.
注意
: Though the
AudioParam
objects returned are read-only, the values they represent are not.
BiquadFilterNode.frequency
只读
AudioParam
, a double representing a frequency in the current filtering algorithm measured in hertz (Hz).
BiquadFilterNode.detune
只读
AudioParam
representing detuning of the frequency in
cents
.
BiquadFilterNode.Q
只读
AudioParam
, a double representing a
Q factor
,或
quality factor
.
BiquadFilterNode.gain
只读
AudioParam
, a double representing the
gain
used in the current filtering algorithm.
BiquadFilterNode.type
type
|
描述 |
frequency
|
Q
|
gain
|
|---|---|---|---|---|
lowpass
|
Standard second-order resonant lowpass filter with 12dB/octave rolloff. Frequencies below the cutoff pass through; frequencies above it are attenuated. | The cutoff frequency. | Indicates how peaked the frequency is around the cutoff. The greater the value is, the greater is the peak. | Not used |
highpass
|
Standard second-order resonant highpass filter with 12dB/octave rolloff. Frequencies below the cutoff are attenuated; frequencies above it pass through. | The cutoff frequency. | Indicates how peaked the frequency is around the cutoff. The greater the value, the greater the peak. | Not used |
bandpass
|
Standard second-order bandpass filter. Frequencies outside the given range of frequencies are attenuated; the frequencies inside it pass through. | The center of the range of frequencies. |
Controls the width of the frequency band. The greater the
Q
value, the smaller the frequency band.
|
Not used |
lowshelf
|
Standard second-order lowshelf filter. Frequencies lower than the frequency get a boost, or an attenuation; frequencies over it are unchanged. | The upper limit of the frequencies getting a boost or an attenuation. | Not used | The boost, in dB, to be applied; if negative, it will be an attenuation. |
highshelf
|
Standard second-order highshelf filter. Frequencies higher than the frequency get a boost or an attenuation; frequencies lower than it are unchanged. | The lower limit of the frequencies getting a boost or an attenuation. | Not used | The boost, in dB, to be applied; if negative, it will be an attenuation. |
peaking
|
Frequencies inside the range get a boost or an attenuation; frequencies outside it are unchanged. | The middle of the frequency range getting a boost or an attenuation. |
Controls the width of the frequency band. The greater the
Q
value, the smaller the frequency band.
|
The boost, in dB, to be applied; if negative, it will be an attenuation. |
notch
|
标准 notch filter, also called a band-stop or band-rejection filter. It is the opposite of a bandpass filter: frequencies outside the give range of frequencies pass through; frequencies inside it are attenuated. | The center of the range of frequencies. |
Controls the width of the frequency band. The greater the
Q
value, the smaller the frequency band.
|
Not used |
allpass
|
Standard second-order allpass filter. It lets all frequencies through, but changes the phase-relationship between the various frequencies. | The frequency with the maximal group delay , that is, the frequency where the center of the phase transition occurs. | Controls how sharp the transition is at the medium frequency. The larger this parameter is, the sharper and larger the transition will be. | Not used |
继承方法来自其父级
AudioNode
.
BiquadFilterNode.getFrequencyResponse()
From the current filter parameter settings this method calculates the frequency response for frequencies specified in the provided array of frequencies.
The following example shows basic usage of an AudioContext to create a Biquad filter node. For a complete working example, check out our voice-change-o-matic demo (look at the 源代码 too).
var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); //set up the different audio nodes we will use for the app var analyser = audioCtx.createAnalyser(); var distortion = audioCtx.createWaveShaper(); var gainNode = audioCtx.createGain(); var biquadFilter = audioCtx.createBiquadFilter(); var convolver = audioCtx.createConvolver(); // connect the nodes together source = audioCtx.createMediaStreamSource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadFilter); biquadFilter.connect(convolver); convolver.connect(gainNode); gainNode.connect(audioCtx.destination); // Manipulate the Biquad filter biquadFilter.type = "lowshelf"; biquadFilter.frequency.setValueAtTime(1000, audioCtx.currentTime); biquadFilter.gain.setValueAtTime(25, audioCtx.currentTime);
| 规范 | 状态 | 注释 |
|---|---|---|
|
Web 音频 API
The definition of 'BiquadFilterNode' in that specification. |
工作草案 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
BiquadFilterNode
|
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 |
BiquadFilterNode()
构造函数
|
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 |
Q
|
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 |
detune
|
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 |
frequency
|
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 |
gain
|
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 |
getFrequencyResponse
|
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 |
type
|
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 |
完整支持
不支持
兼容性未知
见实现注意事项。
BiquadFilterNode
AnalyserNode
AudioBuffer
AudioBufferSourceNode
AudioContext
AudioContextOptions
AudioDestinationNode
AudioListener
AudioNode
AudioNodeOptions
AudioParam
AudioProcessingEvent
AudioScheduledSourceNode
AudioWorklet
AudioWorkletGlobalScope
AudioWorkletNode
AudioWorkletProcessor
BaseAudioContext
ChannelMergerNode
ChannelSplitterNode
ConstantSourceNode
ConvolverNode
DelayNode
DynamicsCompressorNode
GainNode
IIRFilterNode
MediaElementAudioSourceNode
MediaStreamAudioDestinationNode
MediaStreamAudioSourceNode
OfflineAudioCompletionEvent
OfflineAudioContext
OscillatorNode
PannerNode
PeriodicWave
StereoPannerNode
WaveShaperNode