Unosquare
    Show / Hide Table of Contents

    Class AudioSettings

    Settings for audio device.

    Inheritance
    Object
    AudioSettings
    Namespace: Unosquare.RaspberryIO.Computer
    Syntax
    public class AudioSettings : SingletonBase<AudioSettings>

    Methods

    GetState(Int32, String)

    Gets the current audio state.

    Declaration
    public Task<AudioState> GetState(int cardNumber = 0, string controlName = "PCM")
    Parameters
    Type Name Description
    Int32 cardNumber

    The card number.

    String controlName

    Name of the control.

    Returns
    Type Description
    Task<AudioState>

    An AudioState object.

    Exceptions
    Type Condition
    InvalidOperationException

    Invalid command, card number or control name.

    IncrementVolume(Single, Int32, String)

    Increments the volume by decibels.

    Declaration
    public Task IncrementVolume(float decibels, int cardNumber = 0, string controlName = "PCM")
    Parameters
    Type Name Description
    Single decibels

    The decibels to increment or decrement.

    Int32 cardNumber

    The card number.

    String controlName

    Name of the control.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Exceptions
    Type Condition
    InvalidOperationException

    Invalid card number or control name.

    SetVolumeByDecibels(Single, Int32, String)

    Sets the volume by decibels.

    Declaration
    public Task SetVolumeByDecibels(float decibels, int cardNumber = 0, string controlName = "PCM")
    Parameters
    Type Name Description
    Single decibels

    The decibels.

    Int32 cardNumber

    The card number.

    String controlName

    Name of the control.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Exceptions
    Type Condition
    InvalidOperationException

    Invalid card number or control name.

    SetVolumePercentage(Int32, Int32, String)

    Sets the volume percentage.

    Declaration
    public Task SetVolumePercentage(int level, int cardNumber = 0, string controlName = "PCM")
    Parameters
    Type Name Description
    Int32 level

    The percentage level.

    Int32 cardNumber

    The card number.

    String controlName

    Name of the control.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Exceptions
    Type Condition
    InvalidOperationException

    Invalid card number or control name.

    ToggleMute(Boolean, Int32, String)

    Toggles the mute state.

    Declaration
    public Task ToggleMute(bool mute, int cardNumber = 0, string controlName = "PCM")
    Parameters
    Type Name Description
    Boolean mute

    if set to true, mutes the audio.

    Int32 cardNumber

    The card number.

    String controlName

    Name of the control.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Exceptions
    Type Condition
    InvalidOperationException

    Invalid card number or control name.

    Comments

    Back to top Copyright © 2017-2019 Unosquare