AudioNode.numberOfOutputs

The numberOfOutputs property of the AudioNode interface returns the number of outputs coming out of the node. Destination nodes ā€” like AudioDestinationNode ā€” have a value of 0 for this attribute.

Syntax

var numOutputs = audioNode.numberOfOutputs;

Value

An integer ā‰„ 0.

Example

const audioCtx = new AudioContext();

const oscillator = audioCtx.createOscillator();
const gainNode = audioCtx.createGain();

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

console.log(oscillator.numberOfOutputs); // 1
console.log(gainNode.numberOfOutputs); // 1
console.log(audioCtx.destination.numberOfOutputs); // 0

Specifications

Specification Status Comment
Web Audio API
The definition of 'numberOfOutputs' in that specification.
Working Draft Ā 

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
numberOfOutputsChrome Full support 14Edge Full support 12Firefox Full support 25IE No support NoOpera Full support 15Safari Full support 6WebView Android Full support YesChrome Android Full support 18Firefox Android Full support 26Opera Android Full support 14Safari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support Ā 
Full support
No support Ā 
No support

See also