AudioNode: channelCount-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 channelCount-Eigenschaft der AudioNode-Schnittstelle repräsentiert eine Ganzzahl, die verwendet wird, um zu bestimmen, wie viele Kanäle beim Up-Mixen und Down-Mixen von Verbindungen zu beliebigen Eingängen des Knotens verwendet werden.

Die Nutzung und genaue Definition von channelCount hängt vom Wert von AudioNode.channelCountMode ab:

  • Sie wird ignoriert, wenn der Wert von channelCountMode max ist.
  • Sie wird als maximaler Wert verwendet, wenn der Wert von channelCountMode clamped-max ist.
  • Sie wird als exakter Wert verwendet, wenn der Wert von channelCountMode explicit ist.

Wert

Eine Ganzzahl.

Beispiele

js
const audioCtx = new AudioContext();

const oscillator = audioCtx.createOscillator();
const gainNode = audioCtx.createGain();

oscillator.connect(gainNode);
gainNode.connect(audioCtx.destination);

oscillator.channelCount;

Spezifikationen

Specification
Web Audio API
# dom-audionode-channelcount

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
channelCount

Legend

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

Full support
Full support

Siehe auch