AudioNode: channelCount プロパティ

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.

AudioNode インターフェイスの channelCount プロパティは、このノードへの入力についてアップミキシングとダウンミキシングを行う際、何個のチャンネルを用いるかを決定するとき用いる整数です。

channelCount の使用法と正確な定義は、AudioNode.channelCountMode の値によって以下のようになります。

  • channelCountMode の値が max のときは、無視されます。
  • channelCountMode の値が clamped-max のときは、最大値として用いられます。
  • channelCountMode の値が explicit のときは、ちょうどの値として用いられます。

整数です。

js
const audioCtx = new AudioContext();

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

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

oscillator.channelCount;

仕様書

Specification
Web Audio API
# dom-audionode-channelcount

ブラウザーの互換性

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

関連情報