AudioNode: channelCountMode プロパティ
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.
Please help us by answering a few questions.
AudioNode
インターフェイスの channelCountMode
プロパティは、ノードの入力と出力でチャンネルを対応させる方法を表す列挙値です。
値
以下が、列挙値 channelCountMode
の取りうる値とその意味です。
max
-
チャンネルの数は、全接続における最大のチャンネル数です。 この場合、
channelCount
は無視され、アップミキシングのみが発生します。以下の
AudioNode
の子におけるデフォルト値です:GainNode
,DelayNode
,ScriptProcessorNode
,BiquadFilterNode
,WaveShaperNode
clamped-max
-
チャンネル数は、全接続における最大のチャンネル数ですが、
channelCount
の値を上限とします。以下の
AudioNode
の子におけるデフォルト値です:PannerNode
,ConvolverNode
,DynamicsCompressorNode
explicit
-
チャンネル数は、
channelCount
の値になります。以下の
AudioNode
の子におけるデフォルト値です:AudioDestinationNode
,AnalyserNode
,ChannelSplitterNode
,ChannelMergerNode
メモ:
仕様書の以前のバージョンでは、ChannelSplitterNode
でのデフォルト値は max
でした。
例
const audioCtx = new AudioContext();
const oscillator = audioCtx.createOscillator();
const gainNode = audioCtx.createGain();
oscillator.connect(gainNode);
gainNode.connect(audioCtx.destination);
oscillator.channelCountMode = "explicit";
仕様書
Specification |
---|
Web Audio API # dom-audionode-channelcountmode |