Skip to main content

Offline Engine

Renders the graph from audio files to audio files as fast as possible, without real-time constraints. Each entry in inputFiles feeds one input bus of the graph and each entry in outputFiles records one output bus. The render runs when the process action is called and ends when the first input file ends or maxNumberOfSecondsToRender is reached.


Configuration​

Inherits configuration from its parent, Engine.

bufferDurationMs​

Type: Int

Default: 10
Minimum: 1

Duration of the audio the graph processes per call, in milliseconds.

inputFiles​

Type: Array of Audio file

Audio files played into the graph's input buses, one file per bus in order. Each entry is a map with filePath, codec (wav, mp3, ogg or apple; default wav) and numberOfChannels (default 2). The file is read at its own sample rate. Setting this appends to the files already set.

FieldTypeDescription
filePathStringPath to the file. Supports the SDK's path prefixes, e.g. @system/.
codec (Optional)StringContainer/codec of the file. Default: "wav".
numberOfChannels (Optional)IntegerChannel count of the file. Default: 2.
sampleRate (Optional)IntegerSample rate of the file in Hz. 0 leaves it undefined. Default: 0.

maxNumberOfSecondsToRender​

Type: Float

Default: 0.0
Minimum: 0.0

Upper bound on the render length, in seconds. When 0, the render runs until the first input file ends; must be non-zero when there are no input files.

outputFiles​

Type: Array of Audio file

Audio files recorded from the graph's output buses, one file per bus in order. Each entry is a map with filePath, codec (wav, mp3, ogg or apple; default wav), numberOfChannels (default 2) and sampleRate (0, the default, records at the render sample rate). Setting this appends to the files already set.

FieldTypeDescription
filePathStringPath to the file. Supports the SDK's path prefixes, e.g. @system/.
codec (Optional)StringContainer/codec of the file. Default: "wav".
numberOfChannels (Optional)IntegerChannel count of the file. Default: 2.
sampleRate (Optional)IntegerSample rate of the file in Hz. 0 leaves it undefined. Default: 0.

sampleRate​

Type: Int

Default: 0
Minimum: 0

Sample rate the graph is rendered at, in Hz. When 0, the sample rate of the first input file is used; must be set when there are no input files.


Properties​

Inherits properties from its parents, Engine, SwitchboardObject.

This object does not provide any additional properties.


Actions​

Inherits actions from its parents, Engine, SwitchboardObject.

process​

Renders the graph from inputFiles to outputFiles on the caller's thread and returns when the render has finished. Fails if no graph is set and none is passed in graph.

Parameters​

NameTypeDescription
graph (Optional)ObjectA Switchboard.AudioGraph configuration map to render instead of the engine's graph. The graph is created for this render only and does not replace the engine's graph.

Return Value​

Boolean — true on success.


Events​

This object does not provide any events.