Switchboard

Entry point for the Switchboard SDK.

Provides methods to initialize the SDK, create and control audio engines, read and write object properties, and subscribe to events. Objects (the engine and the nodes within it) are referenced by their string ObjectID. Every method returns a SwitchboardResult describing success or failure.

Properties

Link copied to clipboard
val gson: Gson

Functions

Link copied to clipboard
fun addEventListener(objectId: ObjectID, eventName: String, callback: (eventName: String, eventData: Any?) -> Unit): SwitchboardResult<ListenerID>

Adds an event listener for the specified event on the object with the given object ID.

Link copied to clipboard
fun callAction(objectId: ObjectID, actionName: String, params: Map<String, Any> = emptyMap()): SwitchboardResult<String>

Calls an action on the object with the specified object ID.

Link copied to clipboard

Creates an engine with the given JSON configuration.

Creates an engine with the given configuration.

Link copied to clipboard

Deinitializes the Switchboard SDK, releasing the resources it holds.

Link copied to clipboard

Destroys the engine with the given object ID, releasing its resources.

Link copied to clipboard
fun getValue(objectId: ObjectID, key: String): SwitchboardResult<Any?>

Gets the value for the given key from the object with the specified object ID.

Link copied to clipboard

Initializes the Switchboard SDK with the given configuration.

fun initialize(context: Context, appId: String, appSecret: String, extensions: Map<String, Any> = emptyMap()): SwitchboardResult<Unit>

Initializes the Switchboard SDK with the given credentials and extensions.

Link copied to clipboard

Loads a native extension library.

Link copied to clipboard

Removes an event listener with the specified listener ID from the object with the given object ID.

Link copied to clipboard
fun setValue(objectId: ObjectID, key: String, value: Any): SwitchboardResult<Unit>

Sets the value for the given key on the object with the specified object ID.