AudioListener

This module provides the AudioListener component: 3D sound is heard from the position and direction of its node. Sounds are played by AudioSource.

Add it like any other component using the add_component function:

// create a node at position float3(2, 0, 0)
var listenerNode = create_node(NodeData(name="listener_node", position=float3(2, 0, 0)))
// add a component for audio listening
add_component(listenerNode, new AudioListener())

Classes

AudioListener : Component

audio listener component

Usage example:

add_component(node, new AudioListener())
AudioListener.on_update()

update audio listener position and direction