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.
var audioCtx = new AudioContext(); var myDestination = audioCtx.destination; myDestination.maxChannelCount = 2;
An unsigned long
.
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 Voice-change-o-matic or Violent Theremin.
Specification | Status | Comment |
---|---|---|
Web Audio API The definition of 'maxChannelCount' in that specification. | Working Draft |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | 10.0webkit | (Yes) | 25.0 (25.0) | No support | 15.0webkit 22 (unprefixed) | 6.0webkit |
Feature | Android | Edge | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
Basic support | ? | (Yes) | 26.0 | 1.2 | ? | ? | ? | 33.0 |
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/AudioDestinationNode/maxChannelCount