API reference
API reference
Select your platform
No SDKs available
No versions available

Voip Class

The voip API provides platform methods to interact with the voip connections, inputs, syncing, and systems. You can also retrieve different statuses for the current voip state. These methods exist to help integrate a platform solution for voip in your app. Read more about voip in our docs

Static Member Functions

Attempts to establish a Voip session with the specified user. A message of type Message::MessageType::Notification_Voip_StateChange will be posted when the session is established. This function can be safely called from any thread.
Accepts a Voip connection from a given Models.User.
Terminates a Voip session with the specified user. Note that Voip.SetMicrophoneMuted should be used to temporarily stop sending audio; stopping and restarting a Voip session after tearing it down may be an expensive operation. This function can be safely called from any thread.
This function allows you to set a callback that will be called every time audio data is captured by the microphone. The callback function must match this signature: void filterCallback(int16_t pcmData[], size_t pcmDataLength, int frequency, int numChannels); The pcmData param is used for both input and output. pcmDataLength is the size of pcmData in elements. numChannels will be 1 or 2. If numChannels is 2, then the channel data will be interleaved in pcmData. Frequency is the input data sample rate in hertz. This function can be safely called from any thread.
This function is used to enable or disable the local microphone. When muted, the microphone will not transmit any audio. Voip connections are unaffected by this state. New connections can be established or closed whether the microphone is muted or not. This can be used to implement push-to-talk, or a local mute button. The default state is unmuted. This function can be safely called from any thread.
Returns SystemVoip microphone's mute state. The different states are VoipMuteState.
Returns SystemVoip status. The different statuses are SystemVoipStatus.
Gets whether or not a voice connection is using discontinuous transmission (DTX). Both sides must set to using DTX when their connection is established in order for this to be true. Returns unknown if there is no connection.
Gets the current local bitrate used for the connection to the specified user. This is set by the current client. Returns unknown if there is no connection.
Gets the current remote bitrate used for the connection to the specified user. This is set by the client on the other side of the connection. Returns unknown if there is no connection.
The options set for newly created connections to use. Existing connections will continue to use their current settings until they are destroyed and recreated.
Gets whether the microphone is currently available to the app. This can be used to show if the user's voice is able to be heard by other users. Returns a microphone availability state flag which determines whether it is available or not - Models.MicrophoneAvailabilityState.
Sets whether SystemVoip should be suppressed so that this app's Voip can use the microphone and play incoming Voip audio. Once microphone switching functionality for the user is released, this function will no longer work. You can use Voip.GetMicrophoneAvailability() to see if the user has allowed the app access to the microphone. This returns a Models.SystemVoipState object which contains statuses about whether the microphone is muted or whether passthrough is enabled.
Parameters
suppressed
A boolean indicates if the voip is supressed or not.
Indicates that the current microphone availability state has been updated. Use Voip.GetMicrophoneAvailability() to extract the microphone availability state.
Sent to indicate that some part of the overall state of SystemVoip has changed. Use SystemVoipState::Status and the properties of Models.SystemVoipState to extract the state that triggered the notification. Note that the state may have changed further since the notification was generated, and that you may call the GetSystemVoip...() family of functions at any time to get the current state directly.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon