AudioDestinationNode: maxChannelCount プロパティ

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.

maxchannelCountAudioDestinationNode インターフェイスのプロパティで、物理的な機器が扱えるチャンネルの最大数を unsigned long で定義します。

AudioNode.channelCount プロパティは 0 以上この値以下になります。もし OfflineAudioContext のように maxChannelCount0 の場合、チャンネルの数は変更できません。

unsigned long です。

次の例は単純な設定です。AudioDestinationNodemaxChannelCount を 2 にしています。

js
const audioCtx = new AudioContext();
const source = audioCtx.createMediaElementSource(myMediaElement);
source.connect(gainNode);
audioCtx.destination.maxChannelCount = 2;
gainNode.connect(audioCtx.destination);

完全な実装は、MDN Web Audio の Voice-change-o-maticViolent Theremin のような例を参考にしてください。

仕様書

Specification
Web Audio API
# dom-audiodestinationnode-maxchannelcount

ブラウザーの互換性

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
maxChannelCount

Legend

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

Full support
Full support
Partial support
Partial support
Has more compatibility info.

関連情報