Web Audio API
The channelCount property of the AudioNode interface represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node.
channelCount's usage and precise definition depend on the value of AudioNode.channelCountMode:
- It is ignored if the
channelCountModevalue ismax. - It is used as a maximum value if the
channelCountModevalue isclamped-max. - It is used as the exact value if the
channelCountModevalue isexplicit.
Value
An integer.
Examples
const audioCtx = new AudioContext();
const oscillator = audioCtx.createOscillator();
const gainNode = audioCtx.createGain();
oscillator.connect(gainNode);
gainNode.connect(audioCtx.destination);
oscillator.channelCount;
Specifications
Browser compatibility
See also
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
