Audio File
Load an audio file (mp3, wav, flac, ogg, aiff). `waveform` follows the playhead; `buffer` is the whole decoded file.
What it does
Audio File loads a sound file from disk (mp3, wav, flac, ogg, or aiff) and decodes it into two outputs. waveform is a time-sliced signal carrying whatever samples are under the playhead, and animates as the timeline plays. buffer is the whole decoded file at once, for consumers that need random access rather than a moving playhead: granular effects, scrubbing, whole-file analysis.
Start and End trim the file to a window. Speed changes how fast waveform plays through it, and negative values reverse it. Loop Mode decides what happens when playback reaches the out-point, and Trigger restarts playback on demand. The file's sample rate, duration and channel count are also reported as plain numbers.
When to use it
Music, a voice line, a foley hit or an ambience bed brought into the graph
Playback of part of a file only, trimmed with Start and End
Loop, ping-pong, or play-once behaviour at the out-point
The whole file as data for granular synthesis, scrubbing or full-waveform analysis, taken from
bufferPlayback restarted from another node's signal, by pulsing Trigger
| Parameter | Type | Default |
|---|---|---|
file_path | String | "String::new()" |
start | Number | 0 |
end | Number | 0 |
speed | Number | 1 |
loop_mode | String | "Once" |
trigger | OneOf([Boolean, Number]) | — |
Gotchas
waveformandbufferare not interchangeable.waveformcarries only the current frame's samples and moves with the timeline;bufferis the entire file every frame. Wirebufferinto anything that needs to look ahead, look behind, or read the file all at once. A live-playhead consumer fed withbufferdoes not advance on its own.End of
0, or an End at or before Start, means play to the end of the file, not play nothing. Leave End at 0 unless the tail is being trimmed.Channels are downmixed to mono on load. The
channelsoutput reports how many channels the source file had, not how many come out.
Start and End are baked into the file's load and decode step, so changing them re-loads and re-cooks the file rather than shifting playback. Expect a brief recompute when dragging the trim handles, not an instant scrub.
Worked example
Add an Audio File node and set File Path to your sound file.
Drag the in/out handles on the scrub bar (or set Start/End directly) to trim to the section you want.
Set Loop Mode to Loop if the sound should repeat, or leave it at Once for a one-shot.
Wire
waveforminto a Playback or Audio Output node to hear it play; wirebufferinstead if the downstream node needs the whole file (e.g. a granular or analysis node).Pulse Trigger from another node's output to restart playback from the trim start on demand.
See also
Audio Input · Audio Output · Vision Analyze · Numbers, signals & audio