The [name] represents a virtual [link:https://developer.mozilla.org/de/docs/Web/API/AudioListener listener] of the all positional and non-positional audio effects in the scene.
A Verge3D application usually creates a single instance of [name]. It is a mandatory construtor parameter for audios entities like [page:Audio Audio] and [page:PositionalAudio PositionalAudio].
In most cases, the listener object is a child of the camera. So the 3D transformation of the camera represents the 3D transformation of the listener.
[example:webaudio_sandbox webaudio / sandbox]
[example:webaudio_timing webaudio / timing]
[example:webaudio_visualizer webaudio / visualizer]
// create an AudioListener and add it to the camera
var listener = new v3d.AudioListener();
camera.add(listener);
// create a global audio source
var sound = new v3d.Audio(listener);
// load a sound and set it as the Audio object's buffer
var audioLoader = new v3d.AudioLoader();
audioLoader.load('sounds/ambient.ogg', function(buffer) {
sound.setBuffer(buffer);
sound.setLoop(true);
sound.setVolume(0.5);
sound.play();
});
Create a new AudioListener.
The [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext] of the [page:AudioListener listener] given in the constructor.
A [link:https://developer.mozilla.org/en-US/docs/Web/API/GainNode GainNode] created using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain AudioContext.createGain]().
Default is *null*.
Time delta value for audio entities. Use in context of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/linearRampToValueAtTime AudioParam.linearRampToValueAtTimeDefault](). Default is *0*.
Return the [page:AudioListener.gain gainNode].
Set the [page:AudioListener.filter filter] property to *null*.
Returns the value of the [page:AudioListener.filter filter] property.
Set the [page:AudioListener.filter filter] property to *value*.
Return the volume.
Set the volume.
[sourceHint]