VoiceClient

open class VoiceClient(baseUrl: String, transport: TransportFactory, callbacks: VoiceEventCallbacks, options: VoiceClientOptions = VoiceClientOptions())

An RTVI client. Connects to an RTVI backend and handles bidirectional audio and video streaming.

The client must be cleaned up using the release method when it is no longer required.

Parameters

baseUrl

URL of the RTVI backend.

transport

Transport for media streaming.

callbacks

Callbacks invoked when changes occur in the voice session.

options

Additional options for configuring the client and backend.

Constructors

Link copied to clipboard
constructor(baseUrl: String, transport: TransportFactory, callbacks: VoiceEventCallbacks, options: VoiceClientOptions = VoiceClientOptions())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns true if the camera is enabled, false otherwise.

Link copied to clipboard

Returns true if the microphone is enabled, false otherwise.

Link copied to clipboard

Returns the selected video input device.

Link copied to clipboard

Returns the selected audio input device.

Link copied to clipboard

The current state of the session.

Link copied to clipboard

The thread used by the VoiceClient for callbacks and other operations.

Link copied to clipboard

Returns a list of participant media tracks.

Functions

Link copied to clipboard
fun action(service: String, action: String, arguments: List<Option> = emptyList()): Future<Value, VoiceError>

Instruct a backend service to perform an action.

Link copied to clipboard

Returns a list of supported actions.

Link copied to clipboard

Returns the expected structure of the server config.

Link copied to clipboard

Disconnect an active RTVI session.

Link copied to clipboard

Enables or disables the video input device.

Link copied to clipboard

Enables or disables the audio input device.

Link copied to clipboard

Returns a list of available video input devices.

Link copied to clipboard

Returns a list of available audio input devices.

Link copied to clipboard

Gets the current config from the server.

Link copied to clipboard

Initialize local media devices such as camera and microphone.

Link copied to clipboard
fun <E : VoiceClientHelper> registerHelper(service: String, helper: E): E

Registers a new helper with the client.

Link copied to clipboard
fun release()

Destroys this VoiceClient and cleans up any allocated resources.

Link copied to clipboard

Directly send a message to the bot via the transport.

Link copied to clipboard

Initiate an RTVI session, connecting to the backend.

Link copied to clipboard
fun unregisterHelper(service: String)

Unregisters a helper from the client.

Link copied to clipboard

Use the specified video input device.

Link copied to clipboard

Updates the config on the server.

Link copied to clipboard

Use the specified audio input device.