Interface IAudioDevices
An interface to enumerate and manage audio devices.
Inherited Members
Namespace: VivoxUnity
Assembly: VivoxUnity.dll
Syntax
public interface IAudioDevices : INotifyPropertyChanged
Properties
ActiveDevice
The active audio device.
Declaration
IAudioDevice ActiveDevice { get; }
Property Value
Type | Description |
---|---|
IAudio |
AvailableDevices
The available devices on this system.
Declaration
IReadOnlyDictionary<string, IAudioDevice> AvailableDevices { get; }
Property Value
Type | Description |
---|---|
IRead |
Remarks
Note: Call Begin
DeviceEnergy
The audio energy level of this device, normalized to a value between 0 and 1
Declaration
double DeviceEnergy { get; }
Property Value
Type | Description |
---|---|
double |
Remarks
Useful in creating VU meters for testing out the audio levels before login or while logged in
EffectiveDevice
The effective system device.
Declaration
IAudioDevice EffectiveDevice { get; }
Property Value
Type | Description |
---|---|
IAudio |
Remarks
If the active device is set to SystemDevice or CommunicationDevice, then the effective device shows the actual device used.
Note: When the value for this property changes, a PropertyChanged event fires.
Muted
Indicate whether audio is muted for this device.
Declaration
bool Muted { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
Set to true to stop the audio device from capturing or rendering audio. The default is false.
SystemDevice
Call BeginSetActiveDevice() with this device to use whatever the operating system uses for the device.
Declaration
IAudioDevice SystemDevice { get; }
Property Value
Type | Description |
---|---|
IAudio |
VolumeAdjustment
AudioGain for the device.
Declaration
int VolumeAdjustment { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
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 (default). This applies to all active audio sessions.
Methods
BeginRefresh(AsyncCallback)
Refresh the list of available devices.
Declaration
IAsyncResult BeginRefresh(AsyncCallback cb)
Parameters
Type | Name | Description |
---|---|---|
Async |
cb | The function to call when the operation completes. |
Returns
Type | Description |
---|---|
IAsync |
An IAsyncResult. |
Remarks
Call BeginRefresh before accessing the Active
BeginSetActiveDevice(IAudioDevice, AsyncCallback)
Call this to set the active audio device. This takes effect immediately for all open sessions.
Declaration
IAsyncResult BeginSetActiveDevice(IAudioDevice device, AsyncCallback callback)
Parameters
Type | Name | Description |
---|---|---|
IAudio |
device | The active device. |
Async |
callback | Called upon completion. |
Returns
Type | Description |
---|---|
IAsync |
An IAsyncResult. |
EndRefresh(IAsyncResult)
Call this to pick up failures from the BeginRefresh() asynchronous method.
Declaration
void EndRefresh(IAsyncResult result)
Parameters
Type | Name | Description |
---|---|---|
IAsync |
result | The result returned from BeginRefresh. |
EndSetActiveDevice(IAsyncResult)
Call this to pick up failures from the BeginSetActiveDevice() asynchronous method.
Declaration
void EndSetActiveDevice(IAsyncResult result)
Parameters
Type | Name | Description |
---|---|---|
IAsync |
result | The value returned from BeginSetActiveDevice(). |