Skip to main content

AudioPlayer Node

The audio player node can load audio files and play them.

Number of inputs0
Number of outputs1

Configuration

This object does not provide any configuration options.

audioFilePath (Optional)

Type: String

File path of audio file that will be loaded when the node is created.


Values

Inherits values from its parent, SingleBusAudioSourceNode.

isLoopingEnabled

Type: Bool

Indicates whether looping of the audio file is enabled.

position

Type: Double

The current position of the playback head in seconds.

duration (Read only)

Type: Double

The duration of the loaded audio in seconds. 0 is returned if no audio has been loaded.


Actions

Inherits actions from its parent, SingleBusAudioSourceNode.

play

Starts the audio playback.

Parameters

None

pause

Pauses the audio playback.

Parameters

None

stop

Stops the audio playback and resets the playback head to the beginning.

Parameters

None

load

Loads an audio file into memory.

Parameters

NameTypeDescription
audioFilePathStringThe path to the audio file to load.
codec (Optional)StringThe codec to use to decode the audio file. Codec will be automatically selected if this parameters is not provided.

stream

Opens an audio file for reading. The file will be streamed from disk while playing.

Parameters

NameTypeDescription
audioFilePathStringThe path to the audio file to load.
codec (Optional)StringThe codec to use to decode the audio file. Codec will be automatically selected if this parameters is not provided.

Events

Inherits events from its parent, SingleBusAudioSourceNode.

This object does not provide any events.