最終更新:2015-03-14 (土) 14:36:37 (3324d)
BiquadFilterNode
Top / BiquadFilterNode
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#BiquadFilterNode
http://webaudio.github.io/web-audio-api/#the-biquadfilternode-interface
インターフェイス
enum BiquadFilterType { "lowpass", "highpass", "bandpass", "lowshelf", "highshelf", "peaking", "notch", "allpass" } interface BiquadFilterNode : AudioNode { attribute BiquadFilterType type; readonly attribute AudioParam frequency; // in Hertz readonly attribute AudioParam detune; // in Cents readonly attribute AudioParam Q; // Quality factor readonly attribute AudioParam gain; // in Decibels void getFrequencyResponse(Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse); };
例
var filter = context.createBiquadFilter(); filter.type = 3; // In this case it's a lowshelf filter filter.frequency.value = 440; filter.Q.value = 0; filter.gain.value = 0;
プロパティ
プロパティ | 意味 | 単位 | デフォルト値と範囲 |
frequency | 周波数 | ヘルツ | 350Hz, with a nominal range of 10 to the Nyquist frequency (half the sample-rate). |
detune | |||
Q | Q値 | 1, with a nominal range of 0.0001 to 1000. | |
gain | ゲイン | デジベル? | 0, with a nominal range of -40 to 40. |
メソッド
- void getFrequencyResponse?(Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse);
フィルタの種類
- ローパスフィルタ - 特定の周波数より下だけを通す
- ハイパスフィルタ - 特定の周波数より上だけを通す
- バンドパスフィルタ? - 特定の周波数範囲だけを通す
- ローシェルフフィルタ? - 特定の周波数より下を増幅または減衰させる
- ハイシェルフフィルタ? - 特定の周波数より上を増幅または減衰させる
- ピーキングフィルタ? - 特定の周波数を増幅する(減衰も可)
- ノッチフィルタ - 特定の帯域を減衰させる
- オールパスフィルタ? - すべての周波数を通し位相特性だけを回転させる
Web Audio APIでAudioビジュアリゼーションをしてみよう@Homage to Rez
変更点
- The BiquadFilter? enumerated type constants for the .type attribute (which is now a string) no longer appear on the BiquadFilterNode object, and we do not support them on the .type attribute. So you don’t use .LOWPASS (or 0) anymore - you set it to “lowpass”.
- http://updates.html5rocks.com/2014/07/Web-Audio-Changes-in-m36