Web/API/AudioDestinationNode/maxChannelCount

From Get docs

The maxchannelCount property of the AudioDestinationNode interface is an unsigned long defining the maximum amount of channels that the physical device can handle.

The AudioNode.channelCount property can be set between 0 and this value (both included). If maxChannelCount is 0, like in OfflineAudioContext, the channel count cannot be changed.


Syntax

var audioCtx = new AudioContext();
var myDestination = audioCtx.destination;
myDestination.maxChannelCount = 2;

Value

An unsigned long.

Example

The following would set up a simple audio graph, featuring an AudioDestinationNode with maxChannelCount of 2:

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

To see a more complete implementation, check out one of our MDN Web Audio examples, such as [[../../../../../../../mdn.github.io/voice-change-o-matic/index|Voice-change-o-matic]] or [[../../../../../../../mdn.github.io/violent-theremin/index|Violent Theremin]].

Specifications

Specification Status Comment
Web Audio APIThe definition of 'maxChannelCount' in that specification. Working Draft  

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
maxChannelCount Chrome

Full support 14

Edge

Full support 12

Firefox

Full support 25

IE

No support No

Opera

Full support 15

Safari

Full support 6

WebView Android

Full support Yes

Chrome Android

Full support 18

Firefox Android

Full support 26

Opera Android

Full support 14

Safari iOS

Full support Yes

Samsung Internet Android

Full support 1.0

Legend

Full support  
Full support
No support  
No support


See also