IAudioDevices
Reference the IAudioDevices interface for managing audio devices.
읽는 시간 4분최근 업데이트: 7달 전
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
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 with this device to use the operating system's default device.
SetActiveDevice()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 with this device to use the operating system's default communication device.
SetActiveDevice()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(). or AudioOutputDevices(). to prevent Vivox from either capturing audio or rendering audio, respectively.
SetActiveDevice()SetActiveDevice()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 for the actual device currently in use.
EffectiveDevice()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 methods such as ActiveDevice, EffectiveDevice, or AvailableDevices return valid values. Note: It can take up to 200 milliseconds before the list of devices refreshes.
IAudioDevicesPublic Attributes Documentation
variable EventAfterDeviceAvailableAdded
AfterAvailableDeviceAdded EventAfterDeviceAvailableAdded;
This event is raised after a device has been added to the collection.
AvailableDevices()variable EventBeforeAvailableDeviceRemoved
BeforeAvailableDeviceRemoved EventBeforeAvailableDeviceRemoved;
This event is raised before a device is removed from the collection.
AvailableDevices()variable EventEffectiveDeviceChanged
EffectiveDeviceChanged EventEffectiveDeviceChanged;
This event fires when the effective device changes. Use this to inform users that the device in use has changed.