SgAudioListener

Represents the audio listener in the scene, typically attached to the camera or player. It determines how positional audio is perceived based on its location and orientation. Only one SgAudioListener should be active at a time to ensure correct spatial audio playback.

Inherits from

Usage

To use this class, add the following require at the top of your script:

local SgAudioListener = require 'engine/sceneobjects/sgaudiolistener'

Reference

class SgAudioListener
module:
create(options, parent)

Create a new audio listener object in the scenegraph.

Parameters:
  • options (table) – A table of options to fill the parameters

  • parent (SceneObject) – The parent scene object to add this to

Returns:

a promise which will resolve to the created object

Return type:

Promise

Examples