Skip to main content

Audio Graph

The AudioGraph object is responsible for managing audio nodes and the connections between them. It ensures seamless communication between nodes by handling audio format matching, allowing for efficient and flexible audio processing workflows.


Configuration​

maxNumberOfChannels (Optional)​

Type: uint

The maximum number of audio channels. This is used for internal memory allocations. Default value is 2 (stereo).

maxNumberOfFrames (Optional)​

Type: uint

The maximum number of frames in the audio buffers. Default value is 48000 (1 second of audio at 48kHz sample rate).

sampleRate (Optional)​

Type: uint

The internal processing sample rate. Default value is 0 (undefined). When undefined value is set, the graph is processed with the engine's native sample rate.

bufferSize (Optional)​

Type: uint

The internal processing buffer size (in number of frames). This value is only used when a custom sample rate setting is set. Default value is 512.

numberOfInputs (Optional)​

Type: uint

The number of input buses for the audio graph. Default is 1.

numberOfOutputs (Optional)​

Type: uint

The number of output buses for the audio graph. Default is 1.


Properties​

Inherits properties from its parent, SwitchboardObject.


Actions​

Inherits actions from its parent, SwitchboardObject.

addNode​

Adds a node to the audio graph.

Parameters​

NameTypeDescription
confignode configConfiguration for the node to be created.

Return Value​

The String ID of the added audio node.

removeNode​

Removes a node from the audio graph.

Parameters​

NameTypeDescription
idStringID of the node to be removed.

Return Value​

None.

connect​

Connects two nodes in the audio graph.

Parameters​

NameTypeDescription
sourceNodeStringID of the source node to be connected.
destinationNodeStringID of the destination node to be connected.
sourceBusIndex (Optional)UIntThe index of the audio bus on the source node to be connected. When not provided, the first available bus will be connected.
destinationBusIndex (Optional)UIntThe index of the audio bus on the destination node to be connected. When not provided, the first available bus will be connected.

Return Value​

None

disconnect​

Disconnects two nodes in the audio graph.

Parameters​

NameTypeDescription
sourceNodeStringID of the source node of the connection to be removed.
destinationNodeStringID of the destination node of the connection to be removed.
sourceBusIndexUIntThe index of the audio bus on the source node to be disconnected.
destinationBusIndexUIntThe index of the audio bus on the destination node to be disconnected.

Return Value​

None

getState​

Returns the state of the audio graph.

Parameters​

None

Return Value​

An object that describes the state of the audio graph.


Events​

Inherits events from its parent, SwitchboardObject.