BiquadFilterNode: frequency-Eigenschaft

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.

Die frequency-Eigenschaft des BiquadFilterNode-Interfaces ist ein a-rate AudioParam — ein Doppelwert, der eine Frequenz im aktuellen Filteralgorithmus in Hertz (Hz) darstellt.

Der Standardwert ist 350, mit einem nominalen Bereich von 10 bis zur Nyquist Frequenz — das ist die Hälfte der Abtastrate.

Wert

Ein AudioParam.

Hinweis: Obwohl das zurückgegebene AudioParam schreibgeschützt ist, ist der Wert, den es darstellt, nicht.

Beispiele

Das folgende Beispiel zeigt die grundlegende Verwendung eines AudioContext, um einen Biquad-Filterknoten zu erstellen. Für ein vollständiges funktionierendes Beispiel, schauen Sie sich unser voice-change-o-matic Demo an (sehen Sie sich auch den Quellcode an).

js
const audioCtx = new AudioContext();

//set up the different audio nodes we will use for the app
const analyser = audioCtx.createAnalyser();
const distortion = audioCtx.createWaveShaper();
const gainNode = audioCtx.createGain();
const biquadFilter = audioCtx.createBiquadFilter();
const 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.value = 1000;
biquadFilter.gain.value = 25;

Spezifikationen

Specification
Web Audio API
# dom-biquadfilternode-frequency

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
frequency

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Siehe auch