AudioPlayer Node
The audio player node can load audio files and play them.
Number of inputs | 0 |
Number of outputs | 1 |
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
Name | Type | Description |
---|---|---|
audioFilePath | String | The path to the audio file to load. |
codec (Optional) | String | The 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
Name | Type | Description |
---|---|---|
audioFilePath | String | The path to the audio file to load. |
codec (Optional) | String | The 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.