AudioDestinationNode
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
TheAudioDestinationNode interface represents the end destination of an audio graph in a given context — usually the speakers of your device. It can also be the node that will "record" the audio data when used with anOfflineAudioContext.
AudioDestinationNode has no output (as itis the output, no moreAudioNode can be linked after it in the audio graph) and one input. The number of channels in the input must be between0 and themaxChannelCount value or an exception is raised.
TheAudioDestinationNode of a givenAudioContext can be retrieved using theAudioContext.destination property.
| Number of inputs | 1 |
|---|---|
| Number of outputs | 0 |
| Channel count mode | "explicit" |
| Channel count | 2 |
| Channel interpretation | "speakers" |
In this article
Instance properties
Inherits properties from its parent,AudioNode.
AudioDestinationNode.maxChannelCountAn
unsigned longdefining the maximum number of channels that the physical device can handle.
Instance methods
No specific method; inherits methods from its parent,AudioNode.
Example
There is no complex set up for using anAudioDestinationNode — by default, this represents the output of the user's system (e.g., their speakers), so you can get it hooked up inside an audio graph using only a few lines of code:
const audioCtx = new AudioContext();const source = audioCtx.createMediaElementSource(myMediaElement);source.connect(gainNode);gainNode.connect(audioCtx.destination);To see a more complete implementation, check out one of our MDN Web Audio examples, such asVoice-change-o-matic orViolent Theremin.
Specifications
| Specification |
|---|
| Web Audio API> # AudioDestinationNode> |