Seamless audio file input

Seamless Audio File input properties for Script Engine. Plays back an audio file with completely gapless, click-free looping. Supported formats: WAV, MP3, FLAC, OGG, and OPUS. Unlike the regular Audio File Input, the entire file is decoded into memory when it loads, so the loop point produces no audible gap or glitch — perfect for music beds, ambient loops, and short cues that need to repeat seamlessly. In exchange for the perfect loop, the input uses more memory: roughly 1.5 MB per second of audio (a 5-minute clip is around 440 MB). Best suited for short-to-medium clips. For very long files, prefer the regular Audio File Input instead.

Property Type Access Description
ShowAdvancedOptions bool get/set Show or hide the input's advanced settings in the editor UI. [default=false].
SourceUrl Uri get/set Path or URL to the audio file to play. Accepts a local file path or a remote URL pointing at a supported audio format (WAV, MP3, FLAC, OGG, OPUS). Changing this triggers an automatic reload on the next render — the new file is fully decoded into memory before playback begins. Clear the value to stop playback and release the buffer.
MediaPlayerState MediaPlayerState get Current playback state of the input (read-only). Reflects whether the file is NoMedia (nothing loaded), Parsing (decoding into memory), Playing, Paused, Stopped, or in an error state. Driven indirectly by PlayCommand, PauseCommand, StopCommand, and by AutoPlay at load time.
PlayCommand Command get Start playing the loaded audio file.
PauseCommand Command get Pause playback at the current position.
StopCommand Command get Stop playback and rewind to the beginning.
LoopPlayback bool get/set Whether the file restarts seamlessly when it reaches the end. [default=true]. When true, the file plays in a continuous, gapless loop — the main reason to use this input. When false, playback stops at the end and the end-of-file callback (if set) is invoked.
AutoPlay bool get/set Whether the file starts playing as soon as the project loads. [default=true]. When true, playback begins automatically once the source has been decoded into memory. Disable to require an explicit PlayCommand, useful when audio should only start on operator action or via a script trigger.
PlayBackEndOfFileCallback string get/set Name of a script function to call when the file reaches the end. Lets you react to end-of-file from a Script Engine script — for example to chain into the next clip, fire a transition, or log the event. Leave blank to skip the callback. Has no effect when LoopPlayback is true (the file never reaches a true end-of-file in that case).
ComponentLog ComponentLog get Recent log lines from the input — load, decode, state changes, and errors (read-only). A short history of the most recent events, useful for diagnosing why a file failed to load or why playback stopped.
Duration TimeCode get Total length of the loaded audio file, as a time code (read-only). Available once the file has finished decoding into memory.
TimeLeft TimeCode get Time remaining until the playhead reaches the end of the file, as a time code (read-only). Counts down toward zero during playback; resets on every loop. Useful for showing a "time remaining" readout or for triggering events shortly before the loop point.
CurrentTime TimeCode get Current playhead position, as a time code (read-only). Updates continuously while the file is playing. Useful from a script to display the playhead, drive other components, or detect when a particular moment in the audio has been reached.
LoopsPlayed int get How many times the file has looped since playback started (read-only). Only increments when LoopPlayback is true and the file wraps from end back to start. Useful from a script to limit the number of loops or to schedule events on every Nth repeat.
LoadTimeMs string get Time it took to decode the audio file into memory the first time, as a millisecond string (read-only, debug). Useful for understanding how long the initial load takes — large files take longer to decode, which delays the first playback start.
DecodedSamplesInfo string get Information about the decoded audio buffer — sample count and duration (read-only, debug). Confirms how much data was actually decoded into memory after loading.
ParserIterations int get Number of render iterations spent waiting for the file to finish decoding (read-only, debug). Internal diagnostic counter that grows while a freshly loaded file is still being decoded into memory and stops once playback can begin.
AudioTrackInfo Dictionary<string, object> get Metadata about the loaded audio track (read-only). A dictionary with technical details about the audio — codec, sample rate, channel count, bit rate, duration, and so on. Available once the file has finished loading.

Inherits from: AbstractInput, AbstractAudioProcessing, AbstractAudioMetering.

See also: Seamless audio file input in Inputs — user-facing introduction, screenshots, and section summaries.