Preloads an audio file to memory, so that it can be played instantaneously.
After the file has been preloaded and is ready for instant playback, the first output is triggered. The given playback ID can then be used with the Play audio flow function to immediately play the audio file.
If a playback instance with the given ID already exists, any ongoing audio playback will be stopped and the new source file will be loaded into memory, creating a new audio playback instance under the given playback ID.
If there is an error, the second output is triggered.
Label | Key | Type | Required? | Default | Description |
Audio source |
| String(local-filesystem-reference)|String(web-url) | Yes | – | External URL or local filesystem path to the audio file to preload. |
Audio playback ID |
| String | Yes | – | Unique ID for the preloaded audio playback instance. |
Number of outputs: 2
Label | Key | Type | Description |
Audio playback instance |
| Object | Object representing the playback instance after it was preloaded to memory. |
|
| String | Unique ID for this audio playback |
|
| Number | Duration of the audio file, in milliseconds. |
|
| Number | Current time of the ongoing playback, in milliseconds. |
|
| String | Status of the current playback. |
|
| Boolean | True/false value describing if the audio file is set to loop. |
|
| Number | If looping, the number of remaining loops until the playback stops. |
|
| String|String | Absolute local filesystem path or external URL to the audio file being played |
|
| String | ISO 8601 timestamp for when the playback was started. Can be used to calculate e.g. elapsed time. |
No events.
Label | Code | Description |
File not found |
| Thrown if the audio source file could not be found. |
File not an audio file |
| Thrown if the audio source file could not be opened as an audio file. |
Unknown error |
| Thrown if an unknown error occurred while preloading the audio file. |