This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

AudioNode.numberOfInputs

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2015년 7월⁩.

AudioNode 인터페이스의 numberOfInputs 속성은 해당 노드에 공급되는 입력의 수를 반환합니다. 소스 노드는 numberOfInputs 속성의 값이 0인 노드로 정의됩니다.

구문

js
var numInputs = audioNode.numberOfInputs;

integer ≥ 0.

예제

js
const audioCtx = new AudioContext();

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

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

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

명세서

Specification
Web Audio API
# dom-audionode-numberofinputs

브라우저 호환성

같이 보기