You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!
AudioNode
는 포괄적으로 오디오를 처리하는 데이터 소스인 <audio>
테그나 <video>
테그, OscillatorNode
와 audio destinatio, intermediate 처리 모듈인 BiquadFilterNode
or ConvolverNode
또는 볼륨을 조절하는 GainNode
등을 나타냅니다.
AudioNode는 입력과 출력을 가지고 각각의 주어진 채널을 가지고 있습니다. 입력이 0인
AudioNode와 하나 혹은 다수의 출력을 가지면 이를 소스노드라고 불린다.
하나의 AudioNode에서 다른 쪽으로 다양한 처리가 이뤄진다. 일반적으로는 노드는 입력을 읽어 음원관련 처리작업을 하고, 새로운 출력값을 만든다. 아니면 단순히 음원이 지나가는 노드역활만을 하기도 한다.
(for example in the AnalyserNode
, where the result of the processing is accessed separatly).
다른 노드들은 processing graph 를 만들기 위해 서로를 연결한다. graph는 AudioContext
를 가지고 있다. 각각의 노드는 하나이 컨택스트에 관여를 한다. 일반적으로는 처리노드는 AudioNode
의 메서드와 프로퍼티를 상속받아 처리하지만 사용자의 의도에 따라 기능을 추가 할수도 있다. 자세한 Web Audio API 페이지 이다.
Note: An AudioNode
can be target of events, therefore it implements the EventTarget
interface.
Properties
-
AudioNode.context
Read only -
AudioContext
와 연관된 정보를 리턴한다. 노드가 관여하고 있는 processing graph 객체를 나타낸다.
-
AudioNode.numberOfInputs
Read only -
노드에 입력되는 인풋의 수를 리턴받는다. 소스노드는
numberOfInputs 프로퍼티를 가지는데 기본적으로 0 값을 가진다.
-
AudioNode.numberOfOutputs
Read only -
노드를 통해 나오는 출력의 갯수를 리턴한다.
AudioDestinationNode
같은 노드의 경우에는 이 값은 0을 가지고 있다.
-
AudioNode.channelCount
-
인풋에 up-mixing and down-mixing을 하는 경우 몇개의 채널이 사용되는지 갯수를 정수값으로 리턴한다.
AudioNode.channelCountMode
의 값에의해 정확한 갯수를 알수 있다.
-
AudioNode.channelCountMode
- 노드에 입력되는 입력값과 출력값의 연관 정보를 리턴받는다.
-
AudioNode.channelInterpretation
-
음원을 어떻게 up-mixing and down-mixing 하는지에 대한 정보를 리턴받는다. 이 값은
"speakers"
나"discrete" 가 될 수 있다.
Methods
Also implements methods from the interface EventTarget
.
-
AudioNode.connect(AudioNode)
- 다른 노드에서의 입력과 현대 노드의 출력값을 서로 연결시킬수 있다.
-
AudioNode.connect(AudioParam)
- 현재 노드의 출력과 audio parameter의 출력 하나와 연결 시킬수 있다.
-
AudioNode.disconnect()
- 현재의 노드와 연결된 다른 노드와의 연결을 끊을수 있다.
Example
이예제는 간단하게 AudioNode의 프로퍼티와 메서드를 어떻게 사용하는지를 보여 준다.
Web Audio API에 가면 더 많은 예제를 확인 할 수 있다.
var AudioContext = window.AudioContext || window.webkitAudioContext; var audioCtx = new AudioContext(); var oscillator = audioCtx.createOscillator(); var gainNode = audioCtx.createGain(); oscillator.connect(gainNode); gainNode.connect(audioCtx.destination); oscillator.context; oscillator.numberOfInputs; oscillator.numberOfOutputs; oscillator.channelCount;
Specifications
Specification | Status | Comment |
---|---|---|
Web Audio API The definition of 'AudioNode' in that specification. |
Working Draft |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 10.0webkit | 25.0 (25.0) | No support | 15.0webkit 22 (unprefixed) |
(Yes) |
channelCount channelCountMode |
(Yes) webkit | (Yes) | No support | (Yes) | No support |
connect (AudioParam) |
(Yes) webkit | (Yes) | No support | (Yes) | No support |
Feature | Android | Firefox Mobile (Gecko) | Firefox OS (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | ? | 25.0 | 1.2 | ? | ? | ? |
channelCount channelCountMode |
No support | (Yes) | (Yes) | No support | No support | No support |
connect (AudioParam) |
No support | (Yes) | (Yes) | No support | No support | No support |