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.
maxchannelCount
は AudioDestinationNode
インターフェイスのプロパティで、物理的な機器が扱えるチャンネルの最大数を unsigned long
で定義します。
AudioNode.channelCount
プロパティは 0 以上この値以下になります。もし OfflineAudioContext
のように maxChannelCount
が 0
の場合、チャンネルの数は変更できません。
値
unsigned long
です。
例
次の例は単純な設定です。AudioDestinationNode
の maxChannelCount
を 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-matic や Violent Theremin のような例を参考にしてください。
仕様書
Specification |
---|
Web Audio API # dom-audiodestinationnode-maxchannelcount |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
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.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.