In-game control of audio levels
Allow players to control voice and audio levels in-game.
Read time 1 minuteLast updated 2 days ago
You can use the Vivox SDK to allow in-game control for audio input and output levels. The following list details examples of scenarios in which you would want to implement in-game control of audio levels:
- A user wants game sounds and voice output to have different volume levels.
- One user is playing music in the background, and another user wants to reduce the audio volume that is playing.
In the Vivox Unreal SDK, use
IAudioDevices::SetVolumeAdjustment(int value)In the Vivox Unreal SDK, usevoid AdjustOutputVolume(int value){ VivoxVoiceClient.AudioOutputDevices().SetVolumeAdjustment(value);}void AdjustInputVolume(int value){ VivoxVoiceClient.AudioInputDevices().SetVolumeAdjustment(value);}
IParticipantProperties::BeginSetLocalVolumeAdjustmentvoid AdjustParticipantVolume(IParticipant &participant, int value){ IParticipant::FOnBeginSetLocalVolumeAdjustmentCompletedDelegate BeginSetLocalVolumeCompletedCallback; bool IsVolumeAdjusted = false; BeginSetLocalVolumeCompletedCallback.BindLambda([this, &IsVolumeAdjusted](VivoxCoreError Status) { if(VxErrorSuccess ==Status) { IsVolumeAdjusted = true; } }); participant.BeginSetLocalVolumeAdjustment(value,BeginSetLocalVolumeCompletedCallback);}