AudioDestinationNode: maxChannelCount property

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.

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.

Value

An unsigned long.

Examples

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

js
const audioCtx = new AudioContext();
const 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 Voice-change-o-matic or Violent Theremin.

Specifications

Specification
Web Audio API
# dom-audiodestinationnode-maxchannelcount

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
maxChannelCount
Chrome – Full support
Chrome 27 (Release date: 2013-05-21)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 25 (Release date: 2013-10-29)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Partial support
Safari 7 – 14 (Release date: 2013-10-22)
footnote Partial support
footnote This property always returns 0.
Safari – Full support
Safari 14.1 (Release date: 2021-04-26)
footnote Full support
Chrome Android – Full support
Chrome Android 27 (Release date: 2013-05-22)
footnote Full support
Firefox for Android – Full support
Firefox for Android 25 (Release date: 2013-10-29)
footnote Full support
Opera Android – Full support
Opera Android 15 (Release date: 2013-07-08)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 7 – 14 (Release date: 2013-09-18)
footnote Partial support
footnote This property always returns 0.
Safari on iOS – Full support
Safari on iOS 14.5 (Release date: 2021-04-26)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1.5 (Release date: 2013-09-25)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 7 – 14 (Release date: 2013-09-18)
footnote Partial support
footnote This property always returns 0.
WebView on iOS – Full support
WebView on iOS 14.5 (Release date: 2021-04-26)
footnote Full support

Legend

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

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

See also