BaseAudioContext.destination

The destination property of the BaseAudioContext interface returns an AudioDestinationNode representing the final destination of all audio in the context. It often represents an actual audio-rendering device such as your device's speakers.

Value

An AudioDestinationNode.

Examples

Note: for a full example implementation, see one of our Web Audio Demos on the MDN GitHub repo, like voice-change-o-matic.

var AudioContext = window.AudioContext || window.webkitAudioContext;
var audioCtx = new AudioContext();
// Older webkit/blink browsers require a prefix

var oscillatorNode = audioCtx.createOscillator();
var gainNode = audioCtx.createGain();

oscillatorNode.connect(gainNode);
gainNode.connect(audioCtx.destination);

Specifications

Specification
Web Audio API
# dom-baseaudiocontext-destination

Browser compatibility

BCD tables only load in the browser

See also