Skip to main content

SDK Instance

The top-level Switchboard object serves as the primary interface for interacting with the SDK instance. It provides access to various methods and properties that allow developers to configure, initialize, and manage the SDK's functionality. This object acts as the central point for the highest-level operations related to the Switchboard SDK.

Initializing the SDK​

To initialize the Switchboard SDK, call the Switchboard.initialize method and pass in a configuration map. The configuration map should include the parameters described in the Configuration section below.

The method returns the object ID of the SDK instance, which can be used in subsequent calls. Note that only one instance of the SDK can exist at a time.

Config sdkConfig({
{ "appID", "demo" },
{ "appSecret", "demo" }
});
const Result<ObjectID> result = Switchboard::initialize(sdkConfig);

Deinitializing the SDK​

To deinitialize the Switchboard SDK, call the Switchboard.deinitialize method. This will clean up all resources associated with the SDK, and any objects created by the SDK will be destroyed. It is important to ensure that the SDK is deinitialized when it is no longer needed to avoid resource leaks.

const Result<void> result = Switchboard::deinitialize();

Configuration​

appID​

Type: String

The app ID value of the integrating app.

appSecret​

Type: String

The app secret value of the integrating app.

tempDirPath (Optional)​

Type: String

The path to the directory that can hold temporary files.


Properties​

Inherits properties from its parent, SwitchboardObject.

tempDirPath​

Type: String

The path to the directory that can hold temporary files.

logLevel​

Type: String

The logging level for the SDK. Possible values: none, error, warning, info, debug, trace.

isInitialized (Read only)​

Type: Bool

Returns whether the SDK Instance is initialized or not.

appID (Read only)​

Type: String

The app ID value of the integrating app.

versionName (Read only)​

Type: String

The version name of the SDK.

buildNumber (Read only)​

Type: uint

The build number of the SDK.

maxNumberOfFrames (Read only)​

Type: uint

The maximum number of frames that is supported by the SDK.

engines (Read only)​

Type: String Array

Returns the list of engine IDs that have been created.


Actions​

Inherits actions from its parent, SwitchboardObject.

initialize​

Initializes the Switchboard SDK Instance.

Parameters​

SDK configuration Object. Values described under Configuration.

Return Value​

Returns the object ID of the SDK Instance (e.g. "switchboard").

deinitialize​

Deinitializes the Switchboard SDK Instance.

Parameters​

None.

Return Value​

None.

createEngine​

Creates an engine with the given configuration.

Parameters​

Engine configuration object.

Return Value​

The object ID of the created engine.

destroyEngine​

Destroys an engine.

Parameters​

NameTypeDescription
engineIDStringThe object ID of the engine to be destroyed.

getEngineTypes​

Returns the list of engine types that can be created.

Parameters​

None.

Return Value​

A list of strings with the audio engine types.

getNodeTypes​

Returns the list of node types that can be created.

Parameters​

None.

Return Value​

A list of strings with the node types.


Events​

Inherits events from its parent, SwitchboardObject.