This interface represents a processing node which positions / spatializes an incoming audio stream in three-dimensional space. The spatialization is in relation to the AudioContext's AudioListener (listener attribute).
numberOfInputs : 1
numberOfOutputs : 1
The audio stream from the input will be either mono or stereo, depending on the connection(s) to the input.
The output of this node is hard-coded to stereo (2 channels) and currently cannot be configured.
A parameter for directional audio sources, this is an angle, inside of which there will be no volume reduction. The default value is 360.
A parameter for directional audio sources, this is an angle, outside of which the volume will be reduced to a constant value of coneOuterGain. The default value is 360.
A parameter for directional audio sources, this is the amount of volume reduction outside of the coneOuterAngle. The default value is 0.
The AudioContext which owns this AudioNode.
Determines which algorithm will be used to reduce the volume of an audio source as it moves away from the listener. The default is "inverse".
The maximum distance between source and listener, after which the volume will not be reduced any further. The default value is 10000.
The number of inputs feeding into the AudioNode. This will be 0 for an AudioSourceNode.
The number of outputs coming out of the AudioNode. This will be 0 for an AudioDestinationNode.
Determines which spatialization algorithm will be used to position the audio in 3D space. The default is "HRTF".
A reference distance for reducing volume as source move further from the listener. The default value is 1.
Describes how quickly the volume is reduced as source moves away from listener. The default value is 1.
Connects the AudioNode to another AudioNode.
It is possible to connect an AudioNode output to more than one input with multiple calls to connect(). Thus, "fanout" is supported.
It is possible to connect an AudioNode to another AudioNode which creates a cycle. In other words, an AudioNode may connect to another AudioNode, which in turn connects back to the first AudioNode. This is allowed only if there is at least one DelayNode in the cycle or an exception will be thrown.
There can only be one connection between a given output of one specific node and a given input of another specific node. Multiple connections with the same termini are ignored. For example:
nodeA.connect(nodeB);
nodeA.connect(nodeB);
will have the same effect as
nodeA.connect(nodeB);
the AudioNode to connect to.
an index describing which output of the AudioNode from which to connect. An out-of-bound value throws an exception.
an index describing which input of the destination AudioNode to connect to. An out-of-bound value throws an exception.
Connects the AudioNode to an AudioParam, controlling the parameter value with an audio-rate signal.
It is possible to connect an AudioNode output to more than one AudioParam with multiple calls to connect(). Thus, "fanout" is supported.
It is possible to connect more than one AudioNode output to a single AudioParam with multiple calls to connect(). Thus, "fanin" is supported.
An AudioParam will take the rendered audio data from any AudioNode output connected to it and convert it to mono by down-mixing if it is not already mono, then mix it together with other such outputs and finally will mix with the intrinsic parameter value (the value the AudioParam would normally have without any audio connections), including any timeline changes scheduled for the parameter.
There can only be one connection between a given output of one specific node and a specific AudioParam. Multiple connections with the same termini are ignored. For example:
nodeA.connect(param);
nodeA.connect(param);
will have the same effect as
nodeA.connect(param);
the AudioParam to connect to.
an index describing which output of the AudioNode from which to connect. An out-of-bound value throws an exception.
Disconnects an AudioNode's output.
an index describing which output of the AudioNode to disconnect. An out-of-bound value throws an exception.
Describes which direction the audio source is pointing in the 3D cartesian coordinate space. Depending on how directional the sound is (controlled by the cone attributes), a sound pointing away from the listener can be very quiet or completely silent.
The default value is (1,0,0)
Sets the position of the audio source relative to the listener attribute. A 3D cartesian coordinate system is used.
The default value is (0,0,0)
the x coordinates in 3D space.
the y coordinates in 3D space.
the z coordinates in 3D space.
Sets the velocity vector of the audio source. This vector controls both the direction of travel and the speed in 3D space. This velocity relative to the listener's velocity is used to determine how much doppler shift (pitch change) to apply. The units used for this vector is meters / second and is independent of the units used for position and orientation vectors.
The default value is (0,0,0)
a direction vector indicating direction of travel and intensity.