Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/web/api/audiodestinationnode/maxchannelcount/index.md
6532 views
---
title: AudioDestinationNode.maxChannelCount slug: Web/API/AudioDestinationNode/maxChannelCount page-type: web-api-instance-property browser-compat: api.AudioDestinationNode.maxChannelCount
---

{{ APIRef("Web Audio API") }}

The maxchannelCount property of the {{ domxref("AudioDestinationNode") }} interface is an unsigned long defining the maximum amount of channels that the physical device can handle.

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

Value

An unsigned long.

Examples

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

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

{{Specifications}}

Browser compatibility

{{Compat}}

See also