Audio Listener 2D
Hears spatial sound from its node. Without one the camera of the main output listens.
component audio.AudioListener2D
On this page
Try it
Choose the effective listener
The blue mark is an active listener at x=2; the gray mark is the camera at x=0. The orange marker reads the effective position from the real audio service. No sound is played.
Disable Active. After the scene restarts, the service uses the camera fallback and the orange marker moves to x=0. Reset restores the active listener.
Starts the scene; open the example parameters to experiment.
Scene4 nodes
Scriptmain.aes
package demo
import "aego/audio"
// The marker shows the position returned by the real audio service, including
// camera fallback. It does not change the listener or start a sound.
script ListenerIndicator {
func Update(dt float) {
node.SetPosition(audio.ListenerPosition())
}
}
Fields
| Name | Type | Default | Description |
|---|---|---|---|
| Active | bool | true | The first active listener in the hierarchy is used. |
Related guides
- Spatial sound A spatial sound fades and pans with its distance to the listener.
- Audio Sound in Aego is imported clips, played by components, scripts and audio events, and mixed on buses that the player sets in Settings.