docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IAudioDevices

    An interface to enumerate and manage audio devices.

    Inherited Members
    INotifyPropertyChanged.PropertyChanged
    Namespace: VivoxUnity
    Assembly: VivoxUnity.dll
    Syntax
    public interface IAudioDevices : INotifyPropertyChanged

    Properties

    ActiveDevice

    The active audio device.

    Declaration
    IAudioDevice ActiveDevice { get; }
    Property Value
    Type Description
    IAudioDevice

    AvailableDevices

    The available devices on this system.

    Declaration
    IReadOnlyDictionary<string, IAudioDevice> AvailableDevices { get; }
    Property Value
    Type Description
    IReadOnlyDictionary<string, IAudioDevice>
    Remarks

    Note: Call BeginRefresh(AsyncCallback) before accessing this property or values could be stale.

    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
    IAudioDevice
    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
    IAudioDevice

    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
    AsyncCallback cb

    The function to call when the operation completes.

    Returns
    Type Description
    IAsyncResult

    An IAsyncResult.

    Remarks

    Call BeginRefresh before accessing the ActiveDevice, EffectiveDevice, and AvailableDevices properties. Note: It can take up to 200 milliseconds before the list of devices refreshes.

    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
    IAudioDevice device

    The active device.

    AsyncCallback callback

    Called upon completion.

    Returns
    Type Description
    IAsyncResult

    An IAsyncResult.

    EndRefresh(IAsyncResult)

    Call this to pick up failures from the BeginRefresh() asynchronous method.

    Declaration
    void EndRefresh(IAsyncResult result)
    Parameters
    Type Name Description
    IAsyncResult 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
    IAsyncResult result

    The value returned from BeginSetActiveDevice().

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)