Documentation

​
​

Development

User Acquisition

Monetization

Industry

Vivox Unreal SDK

Vivox Unreal SDK

Vivox
​
​
Vivox Unreal SDK
  • Overview
  • Get started
  • Release notes
  • Developer guide
    • Set up your project
    • Unity Authentication Service in Unreal
    • Create voice and text channels
    • Messaging
    • Audio management
      • In-game audio control
        • In-game audio device selection
        • In-game control of audio levels
        • Create a dynamic voice energy meter
    • Muting
    • In-game moderation
    • Android app development
    • iOS app development
    • Server-side recording
    • Speech-to-text audio transcription
    • Text-to-speech
    • Real-time recording
    • Transmission
    • Troubleshooting
  • Tutorials
  • Reference
  1. Vivox Unreal SDK documentation
  2. Audio

In-game audio device selection

Allow players to select audio input and output devices.
Read time 2 minutes
Last updated 8 months ago

The Vivox SDK automatically uses the system default audio input and output devices. However, you can override this behavior and provide users with a choice of which audio device to use for group voice chat independent of the audio devices that are used for the game.
To perform this override, build a user interface for the game that displays a list of available devices to users that they can select a device from. Build this user interface with the following requests, where audio output devices are called render devices, and audio input devices are called capture devices:
  • VivoxCoreError IAudioDevices::SetActiveDevice(const FString \&device, const FOnSetActiveDeviceCompletedDelegate \&theDelegate=FOnSetActiveDeviceCompletedDelegate())
  • const TMap<FString, IAudioDevice *> \&IAudioDevices::AvailableDevices()
  • const IAudioDevice IAudioDevices::CommunicationDevice()
  • const IAudioDevice IAudioDevices::SystemDevice()
  • const IAudioDevice IAudioDevices::NullDevice()
  • const IAudioDevice IAudioDevices::ActiveDevice()
  • const IAudioDevice IAudioDevices::EffectiveDevice()
IAudioDevices::AvailableDevices
returns a
TMap<FString, IAudioDevice \*>
map that contains a list of every device name and its corresponding Vivox
IAudioDevice
object. Use this request to populate a drop-down menu or to find an appropriate
IAudioDevice
instance to pass in to
IAudioDevices::SetActiveDevice
.
The following code is an example of how to activate the devices that the user selects:
void UMyClass::SetAudioDevice(const IAudioDevice &inputToSet, const IAudioDevice &outputToSet){ // IClient *VivoxVoiceClient; if (VivoxVoiceClient->AudioInputDevices().ActiveDevice().Id() != inputToSet.Id()) { VivoxVoiceClient->AudioInputDevices().SetActiveDevice(inputToSet); } if (VivoxVoiceClient->AudioOutputDevices().ActiveDevice().Id() != outputToSet.Id()) { VivoxVoiceClient->AudioOutputDevices().SetActiveDevice(outputToSet); }}
When a user selects a new device, the game passes the appropriate
IAudioDevice
in to
IAudioDevices::SetActiveDevice
.
Alternately, you can pass a virtual device, such as
IAudioDevices::SystemDevice()
or
IAudioDevices::CommunicationDevice()
, in to
IAudioDevices::SetActiveDevice
to set the
ActiveDevice
to the system's default device or the system's communication device, respectively.
Set
IAudioDevices::NullDevice()
explicitly to prevent input or output.
To alert the game to changes in the IAudioDevices setup, bind to the following events:
  • IAudioDevices::EventAfterDeviceAvailableAdded
  • IAudioDevices::EventBeforeAvailableDeviceRemoved
  • IAudioDevices::EventEffectiveDeviceChanged
Binding to these events helps you to build a responsive system that can handle device hotswapping.

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.


    Report a problem with this page