Safe Voice Consent API
Learn to implement the Safe Voice Consent Application Programming Interface.
Read time 1 minuteLast updated 2 days ago
To utilize Safe Voice with Vivox in Unreal, all users must grant consent to have their voice chat recorded by the Safe Voice service. Two APIs exist in the ILoginSession of the Vivox Unreal SDK to allow for consent to be updated and checked:
ILoginSession::BeginSetSafeVoiceConsent- Use this request to change or set a user's consent status.
ILoginSession::BeginGetSafeVoiceConsent- Use this request to check a user's consent status.
- The Unity Project ID
- Unity Environment ID
- The Authentication Token of an actively authenticated login to the Unity Authentication Service.
The following code sample is an example of using
ILoginSession::BeginSetSafeVoiceConsentThe following code sample is an example of usingILoginSession::FOnBeginSetSafeVoiceConsentCompletedDelegate OnBeginSetSafeVoiceConsentCompletedCallback;OnBeginSetSafeVoiceConsentCompletedCallback.BindLambda([this](VivoxCoreError status, bool consentStatus){ //React to the consentStatus that was set here});ILoginSession& loginSession = GetClient().GetLoginSession(m_account);loginSession.BeginSetSafeVoiceConsentStatus(consentToSet, unityEnvironmentId, unityProjectId, UASToken, OnBeginSetSafeVoiceConsentCompletedCallback);
ILoginSession::BeginGetSafeVoiceConsentILoginSession::FOnBeginGetSafeVoiceConsentCompletedDelegate OnBeginGetSafeVoiceConsentCompletedCallback;OnBeginGetSafeVoiceConsentCompletedCallback.BindLambda([this](VivoxCoreError status, bool consentStatus){ //React to the consentStatus that was set here});ILoginSession& loginSession = GetClient().GetLoginSession(m_account);loginSession.BeginGetSafeVoiceConsentStatus(unityEnvironmentId, unityProjectId, UASToken, OnBeginGetSafeVoiceConsentCompletedCallback);