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.
Values
Inherits values from its parent, SwitchboardObject.
Actions
Inherits actions from its parent, SwitchboardObject.
addNode
Adds a node to the audio graph.
Parameters
Name | Type | Description |
---|---|---|
config | node config | Configuration for the node to be created. |
removeNode
Removes a node from the audio graph.
Parameters
Name | Type | Description |
---|---|---|
id | String | ID of the node to be removed. |
connect
Connects two nodes in the audio graph.
Parameters
Name | Type | Description |
---|---|---|
sourceNode | String | ID of the source node to be connected. |
destinationNode | String | ID of the destination node to be connected. |
sourceBusIndex (Optional) | UInt | The index of the audio bus on the source node to be connected. When not provided, the first available bus will be connected. |
destinationBusIndex (Optional) | UInt | The 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
Name | Type | Description |
---|---|---|
sourceNode | String | ID of the source node of the connection to be removed. |
destinationNode | String | ID of the destination node of the connection to be removed. |
sourceBusIndex | UInt | The index of the audio bus on the source node to be disconnected. |
destinationBusIndex | UInt | The 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.