SgPositionalAudio

Reference

class SgPositionalAudio
module:
create(options, parent)

Create a new positional audio 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

fromObject(obj)

Create an positional audio object from another scene object

Parameters:

obj (SceneObject) – The scene object to convert

fromHandle(handle, nodeId)

create an positional audio object from a handle. Used internally.

Parameters:
  • handle (number)

  • nodeId (str)

Returns:

result object

Return type:

SgPositionalAudio

play(force)

playback the audio

Parameters:

force (boolean) – Force the sound to replay even if it is already playing

stop()

stop the audio

isPlaying()

Checks if the audio is playing

Returns:

true, if sound is playing, false otherwise

Return type:

boolean

Examples