OscillatorNode: detune-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 detune-Eigenschaft des OscillatorNode-Interfaces ist ein a-rate AudioParam, das die Verstimmung der Oszillation in Cents darstellt.

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

Wert

Beispiele

Das folgende Beispiel zeigt die grundlegende Verwendung eines AudioContext, um einen Oszillator-Knoten zu erstellen. Für angewandte Beispiele/Informationen lesen Sie unser Violent Theremin Demo (siehe app.js für den relevanten Code).

js
// create web audio api context
const audioCtx = new AudioContext();

// create Oscillator node
const oscillator = audioCtx.createOscillator();

oscillator.type = "square";
oscillator.frequency.setValueAtTime(440, audioCtx.currentTime); // value in hertz
oscillator.detune.setValueAtTime(100, audioCtx.currentTime); // value in cents
oscillator.start();

Spezifikationen

Specification
Web Audio API
# dom-oscillatornode-detune

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
detune

Legend

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

Full support
Full support

Siehe auch