Class AudioManager

    Definition

    Namespace:
    Tizen.Multimedia
    Assembly:
    Tizen.Multimedia.dll

    Provides functionality to control volume levels and monitor the status of audio devices within the system. The AudioManager class enables developers to retrieve the volume controller, obtain a list of currently connected audio devices, and subscribe to events related to device connection changes as well as audio stream status changes, thereby facilitating comprehensive audio management.

    public static class AudioManager
    Inheritance
    object
    AudioManager

    Properties

    View Source

    VolumeController

    Gets the volume controller, which allows for adjustment and retrieval of the current audio volume level. This property provides access to methods and properties that enable developers to manage volume settings for different audio streams and ensure that the audio experience meets user preferences.

    Declaration
    public static AudioVolume VolumeController { get; }
    Property Value
    Type Description
    AudioVolume

    The AudioVolume.

    Methods

    View Source

    GetConnectedDevices()

    Retrieves a collection of all audio devices currently connected to the system. This method returns an System.Collections.Generic.IEnumerable<T>, allowing developers to easily enumerate through all available audio devices, such as speakers, microphones, and headphones. It is useful for applications that need to adapt to changes in the audio environment or support multiple audio output/input devices.

    Declaration
    public static IEnumerable<AudioDevice> GetConnectedDevices()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T><AudioDevice>

    An IEnumerable<AudioDevice> that contains connected devices.

    Events

    View Source

    DeviceConnectionChanged

    Occurs when the state of an audio device connection changes, such as when a device is connected or disconnected. Subscribing to this event allows developers to be notified of changes in the audio setup, enabling dynamic adjustments in the application to accommodate new devices or handle disconnections accordingly.

    Declaration
    public static event EventHandler<AudioDeviceConnectionChangedEventArgs> DeviceConnectionChanged
    Event Type
    Type Description
    System.EventHandler<TEventArgs><AudioDeviceConnectionChangedEventArgs>
    View Source

    DeviceRunningChanged

    Occurs when an audio stream starts running on a connected audio device. This event is triggered when a new audio stream begins after all previous streams have stopped. It is important to note that if this event is invoked while an audio stream is still running, it will not be triggered again until all streams have been stopped and a new one starts. This is especially useful for managing audio playback scenarios where multiple audio streams may be played sequentially.

    Declaration
    public static event EventHandler<AudioDeviceRunningChangedEventArgs> DeviceRunningChanged
    Event Type
    Type Description
    System.EventHandler<TEventArgs><AudioDeviceRunningChangedEventArgs>
    Remarks

    If this event is invoked once and the audio stream is still running on the device,
    this event will not be invoked anymore, even if there are more audio streams to run.
    This event is invoked only when all streams are stopped and a new stream starts to run.

    Exceptions
    Type Condition
    System.InvalidOperationException

    AudioManager failed to communicate internally or allocate memory.

    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX