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::FDelegate | FOnSetActiveDeviceCompletedDelegate The delegate that is called when SetActiveDevice completes. FString equals new |
Public Functions
Name | |
|---|---|
| virtual const IAudioDevice & | SystemDevice() const =0 Call |
| virtual const IAudioDevice & | CommunicationDevice() const =0 Call |
| virtual const IAudioDevice & | NullDevice() const =0 Pass this device to AudioInputDevices(). |
| virtual const TMap< FString, IAudioDevice * > & | AvailableDevices() const =0 The available devices on this system. Lists both "virtual" and physical devices. |
| 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. |
| virtual const IAudioDevice & | ActiveDevice() =0 The virtual or physical audio device selected for active use if available. See |
| 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 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. |
| 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. |
| virtual bool | Muted() const =0 Indicates if audio is muted for this device. |
| virtual void | SetMuted(bool value) =0 Set whether audio is muted for this device. |
| virtual void | Refresh() =0 Refresh the list of available devices. |
Public Attributes
Name | |
|---|---|
| AfterAvailableDeviceAdded | EventAfterDeviceAvailableAdded This event is raised after a device has been added to the |
| BeforeAvailableDeviceRemoved | EventBeforeAvailableDeviceRemoved This event is raised before a device is removed from the |
| EffectiveDeviceChanged | EventEffectiveDeviceChanged 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
The delegate that is called when SetActiveDevice completes. FString equals newtypedef FDelegateSetActiveDeviceCompleted::FDelegate IAudioDevices::FOnSetActiveDeviceCompletedDelegate;
ActiveDevice().Id()Public Functions Documentation
function SystemDevice
Callvirtual const IAudioDevice & SystemDevice() const =0
SetActiveDevice()function CommunicationDevice
Callvirtual const IAudioDevice & CommunicationDevice() const =0
SetActiveDevice()function NullDevice
Pass this device to AudioInputDevices().virtual const IAudioDevice & NullDevice() const =0
SetActiveDevice()SetActiveDevice()function AvailableDevices
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().virtual const TMap< FString, IAudioDevice * > & AvailableDevices() const =0
function SetActiveDevice
Call this to set the active audio device. Note that this takes effect immediately for all open sessions. Parameters:virtual VivoxCoreError SetActiveDevice( const IAudioDevice & device, const FOnSetActiveDeviceCompletedDelegate & theDelegate =FOnSetActiveDeviceCompletedDelegate()) =0
- device The device to set as active.
- theDelegate A delegate to call when this operation completes.
function ActiveDevice
The virtual or physical audio device selected for active use if available. Seevirtual const IAudioDevice & ActiveDevice() =0
EffectiveDevice()function EffectiveDevice
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 const IAudioDevice & EffectiveDevice() =0
function VolumeAdjustment
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 int VolumeAdjustment() =0
function SetVolumeAdjustment
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:virtual VivoxCoreError SetVolumeAdjustment( int value) =0
- value The audio gain value to set.
function Muted
Indicates if audio is muted for this device.virtual bool Muted() const =0
function SetMuted
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.virtual void SetMuted( bool value) =0
function Refresh
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 beforevirtual void Refresh() =0
IAudioDevicesPublic Attributes Documentation
variable EventAfterDeviceAvailableAdded
This event is raised after a device has been added to theAfterAvailableDeviceAdded EventAfterDeviceAvailableAdded;
AvailableDevices()variable EventBeforeAvailableDeviceRemoved
This event is raised before a device is removed from theBeforeAvailableDeviceRemoved EventBeforeAvailableDeviceRemoved;
AvailableDevices()variable EventEffectiveDeviceChanged
This event fires when the effective device changes. Use this to inform users that the device in use has changed.EffectiveDeviceChanged EventEffectiveDeviceChanged;