Documentation

Support

Vivox Unreal SDK

Vivox Unreal SDK

IAudioDevices

Reference the IAudioDevices interface for managing audio devices.
Read time 4 minutesLast updated 2 days ago

An interface to enumerate and manage audio devices.
#include <IAudioDevices.h>

Public Types

Name

typedef FDelegateSetActiveDeviceCompleted::FDelegateFOnSetActiveDeviceCompletedDelegate
The delegate that is called when SetActiveDevice completes. FString equals new
ActiveDevice().Id().

Public Functions

Name

virtual const IAudioDevice &SystemDevice() const =0
Call
SetActiveDevice()
with this device to use the operating system's default device.
virtual const IAudioDevice &CommunicationDevice() const =0
Call
SetActiveDevice()
with this device to use the operating system's default communication device.
virtual const IAudioDevice &NullDevice() const =0
Pass this device to AudioInputDevices().
SetActiveDevice()
or AudioOutputDevices().
SetActiveDevice()
to prevent Vivox from either capturing audio or rendering audio, respectively.
virtual const TMap< FString, IAudioDevice * > &AvailableDevices() const =0
The available devices on this system. Lists both "virtual" and physical devices.
virtual VivoxCoreErrorSetActiveDevice(const IAudioDevice & device, const FOnSetActiveDeviceCompletedDelegate & theDelegate =FOnSetActiveDeviceCompletedDelegate()) =0
Call this to set the active audio device. Note that this takes effect immediately for all open sessions.
virtual const IAudioDevice &ActiveDevice() =0
The virtual or physical audio device selected for active use if available. See
EffectiveDevice()
for the actual device currently in use.
virtual const IAudioDevice &EffectiveDevice() =0
The effective audio device. If the active device is set to SystemDevice or CommunicationDevice, then the effective device shows the actual device used. If the active device is set to NullDevice or a physical device no longer connected to the system, then no device is effectively in use, and NullDevice is returned. If the active device is set to a specific physical device which is still connected to the system, then that device will be returned.
virtual intVolumeAdjustment() =0
The audio gain for the device. This is a value between -50 and 50. Positive values make the audio louder, and negative values make the audio quieter. 0 leaves the value unchanged (this is the default value). Note: This applies to all active audio sessions.
virtual VivoxCoreErrorSetVolumeAdjustment(int value) =0
Set the audio gain for the device. This is a value between -50 and 50. Positive values make the audio louder, and negative values make the audio quieter. 0 leaves the value unchanged (this is the default value). Note: This applies to all active audio sessions.
virtual boolMuted() const =0
Indicates if audio is muted for this device.
virtual voidSetMuted(bool value) =0
Set whether audio is muted for this device.
virtual voidRefresh() =0
Refresh the list of available devices.

Public Attributes

Name

AfterAvailableDeviceAddedEventAfterDeviceAvailableAdded
This event is raised after a device has been added to the
AvailableDevices()
collection.
BeforeAvailableDeviceRemovedEventBeforeAvailableDeviceRemoved
This event is raised before a device is removed from the
AvailableDevices()
collection.
EffectiveDeviceChangedEventEffectiveDeviceChanged
This event fires when the effective device changes. Use this to inform users that the device in use has changed.

Public Types Documentation

typedef FOnSetActiveDeviceCompletedDelegate

typedef FDelegateSetActiveDeviceCompleted::FDelegate IAudioDevices::FOnSetActiveDeviceCompletedDelegate;
The delegate that is called when SetActiveDevice completes. FString equals new
ActiveDevice().Id()
.

Public Functions Documentation

function SystemDevice

virtual const IAudioDevice & SystemDevice() const =0
Call
SetActiveDevice()
with this device to use the operating system's default device.
Remark: Name and ID show the current values of the underlying device this virtual device is tracking.

function CommunicationDevice

virtual const IAudioDevice & CommunicationDevice() const =0
Call
SetActiveDevice()
with this device to use the operating system's default communication device.
Remark: Name and ID show the current values of the underlying device this virtual device is tracking. Note: This always points to the same physical device as SystemDevice, except on Windows, Android, and Xbox platforms, where it can differ.

function NullDevice

virtual const IAudioDevice & NullDevice() const =0
Pass this device to AudioInputDevices().
SetActiveDevice()
or AudioOutputDevices().
SetActiveDevice()
to prevent Vivox from either capturing audio or rendering audio, respectively.
Remark: Name and ID show "No Device".

function AvailableDevices

virtual const TMap< FString, IAudioDevice * > & AvailableDevices() const =0
The available devices on this system. Lists both "virtual" and physical devices. Remark: Key equals the IAudioDevice Value's Id(). Virtual devices appear on the available device list with their virtual Name and ID, for example: "Default System Device". The IAudioDevice reference returned by SystemDevice() and similar methods show what the effective device would be upon setting it active. To set a virtual device as active, you can use either IAudioDevice with SetActiveDevice().

function SetActiveDevice

virtual VivoxCoreError SetActiveDevice( const IAudioDevice & device, const FOnSetActiveDeviceCompletedDelegate & theDelegate =FOnSetActiveDeviceCompletedDelegate()) =0
Call this to set the active audio device. Note that this takes effect immediately for all open sessions. Parameters:
  • device The device to set as active.
  • theDelegate A delegate to call when this operation completes.
Return: VxErrorInvalidArgument if device is empty.

function ActiveDevice

virtual const IAudioDevice & ActiveDevice() =0
The virtual or physical audio device selected for active use if available. See
EffectiveDevice()
for the actual device currently in use.

function EffectiveDevice

virtual const IAudioDevice & EffectiveDevice() =0
The effective audio device. If the active device is set to SystemDevice or CommunicationDevice, then the effective device shows the actual device used. If the active device is set to NullDevice or a physical device no longer connected to the system, then no device is effectively in use, and NullDevice is returned. If the active device is set to a specific physical device which is still connected to the system, then that device will be returned.

function VolumeAdjustment

virtual int VolumeAdjustment() =0
The audio gain for the device. This is a value between -50 and 50. Positive values make the audio louder, and negative values make the audio quieter. 0 leaves the value unchanged (this is the default value). Note: This applies to all active audio sessions.

function SetVolumeAdjustment

virtual VivoxCoreError SetVolumeAdjustment( int value) =0
Set the audio gain for the device. This is a value between -50 and 50. Positive values make the audio louder, and negative values make the audio quieter. 0 leaves the value unchanged (this is the default value). Note: This applies to all active audio sessions. Parameters:
  • value The audio gain value to set.
Return: VxErrorInvalidArgument if the value is outside of -50 -> 50

function Muted

virtual bool Muted() const =0
Indicates if audio is muted for this device.

function SetMuted

virtual void SetMuted( bool value) =0
Set whether audio is muted for this device. Set to true to stop the audio device from capturing or rendering audio. The default is false.

function Refresh

virtual void Refresh() =0
Refresh the list of available devices. Remark: Manual use of this method should be rare, because the device lists automatically refresh when Vivox initializes and when the system raises an automatic device hotswap event. An automatic or manual call must complete before
IAudioDevices
methods such as ActiveDevice, EffectiveDevice, or AvailableDevices return valid values. Note: It can take up to 200 milliseconds before the list of devices refreshes.

Public Attributes Documentation

variable EventAfterDeviceAvailableAdded

AfterAvailableDeviceAdded EventAfterDeviceAvailableAdded;
This event is raised after a device has been added to the
AvailableDevices()
collection.

variable EventBeforeAvailableDeviceRemoved

BeforeAvailableDeviceRemoved EventBeforeAvailableDeviceRemoved;
This event is raised before a device is removed from the
AvailableDevices()
collection.

variable EventEffectiveDeviceChanged

EffectiveDeviceChanged EventEffectiveDeviceChanged;
This event fires when the effective device changes. Use this to inform users that the device in use has changed.