Files
6 nodes
On this page 6
Load Audio
FunctionOpens an audio file - WAV, MP3, M4A/AAC, FLAC, Ogg Vorbis or Ogg Opus - at its own sample rate and channel count.
Signature
LoadAudio(path: Text) -> AudioBuffer
AudioBuffer LoadAudio(string path)
Parameters
| name | type | default | description |
|---|---|---|---|
| path | Text | — | The file to open. |
Returns
| Audio | AudioBuffer |
Remarks
The format is read from the file's first bytes, not its name, so a mislabelled file still opens.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Files
- Package
- Audio Processing
Load Audio Bytes
FunctionDecodes an audio file that is already in memory - an asset, a download, an attachment.
Signature
LoadAudioBytes(bytes: Byte Array) -> AudioBuffer
AudioBuffer LoadAudioBytes(byte[] bytes)
Parameters
| name | type | default | description |
|---|---|---|---|
| bytes | Byte Array | — | The whole file, as it would be on disk. |
Returns
| Audio | AudioBuffer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Files
- Package
- Audio Processing
Save FLAC
FunctionSaves a clip as a FLAC file - lossless, and usually about half the size of the WAV.
Signature
SaveFlac(audio: AudioBuffer, path: Text) -> Text
string SaveFlac(AudioBuffer audio, string path)
Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip to save. |
| path | Text | — | Where to write it; a .flac name is conventional. |
Returns
| Path | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Files
- Package
- Audio Processing
Save WAV
FunctionSaves a clip as a 16-bit WAV file, creating the folder if it is not there.
Signature
SaveWav(audio: AudioBuffer, path: Text) -> Text
string SaveWav(AudioBuffer audio, string path)
Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip to save. |
| path | Text | — | Where to write it; a .wav name is conventional. |
Returns
| Path | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Files
- Package
- Audio Processing
Supported Extensions
FunctionThe file extensions AudioFiles.LoadAudio can open.
Signature
SupportedExtensions() -> Text Array
string[] SupportedExtensions()
Returns
| Extensions | Text Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Files
- Package
- Audio Processing
To WAV Bytes
FunctionA clip as the bytes of a 16-bit WAV file, without touching the disk - for sending, embedding or serving.
Signature
ToWavBytes(audio: AudioBuffer) -> Byte Array
byte[] ToWavBytes(AudioBuffer audio)
Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip to encode. |
Returns
| Bytes | Byte Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Files
- Package
- Audio Processing