Divooka Reference

Files

6 nodes

On this page 6

Load Audio

Function

Opens 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

nametypedefaultdescription
pathText—The file to open.

Returns

AudioAudioBuffer

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

Function

Decodes 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

nametypedefaultdescription
bytesByte Array—The whole file, as it would be on disk.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Files
Package
Audio Processing

Save FLAC

Function

Saves 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

nametypedefaultdescription
audioAudioBuffer—The clip to save.
pathText—Where to write it; a .flac name is conventional.

Returns

PathText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Files
Package
Audio Processing

Save WAV

Function

Saves 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

nametypedefaultdescription
audioAudioBuffer—The clip to save.
pathText—Where to write it; a .wav name is conventional.

Returns

PathText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Files
Package
Audio Processing

Supported Extensions

Function

The file extensions AudioFiles.LoadAudio can open.

Signature
SupportedExtensions() -> Text Array
string[] SupportedExtensions()

Returns

ExtensionsText Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Files
Package
Audio Processing

To WAV Bytes

Function

A 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

nametypedefaultdescription
audioAudioBuffer—The clip to encode.

Returns

BytesByte Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Files
Package
Audio Processing