Device Management
This tutorial explains how to set up audio device management with a simple user interface.
Prerequisites
Before you start, follow the common setup tutorial.
Sample menu
Open the sample menu by pressing "M".
Open the "Audio input devices" combo box and select the desired device. The plugin should now use that device for audio input.
Open the "Audio output devices" combo box and select the desired device. The plugin should now use that device for audio output.
How it works
W_DolbyIOSampleDeviceControls
is a sample widget whose "Audio input devices" and "Audio output devices" combo boxes are filled using Get Audio Input Devices
and Get Audio Output Devices
. We also save the input and output devices in variables and use Get Current Audio Input Device
and Get Current Audio Output Device
to select the devices that are currently in use.
When you select a device from the combo box, we get a corresponding device from a variable and use Set Audio Input Device
or Set Audio Output Device
.
Using the same audio output device as Unreal Engine 5
In Unreal Engine 5, you can ensure the plugin uses the same audio output device as the engine itself by handling the engine's Audio Device Notification Subsystem
's Device Switched
event as shown below: