Table of Contents

Class AudioSessionControl

Namespace
NAudio.CoreAudioApi
Assembly
NAudio.Wasapi.dll

AudioSessionControl object for information regarding an audio session

public class AudioSessionControl : IDisposable
Inheritance
AudioSessionControl
Implements
Inherited Members

Properties

AudioMeterInformation

Audio meter information of the audio session.

public AudioMeterInformation AudioMeterInformation { get; }

Property Value

AudioMeterInformation

DisplayName

The name of the audio session.

public string DisplayName { get; set; }

Property Value

string

GetProcessID

The process identifier of the audio session.

public uint GetProcessID { get; }

Property Value

uint

GetSessionIdentifier

The session identifier of the audio session.

public string GetSessionIdentifier { get; }

Property Value

string

GetSessionInstanceIdentifier

The session instance identifier of the audio session.

public string GetSessionInstanceIdentifier { get; }

Property Value

string

IconPath

the path to the icon shown in the mixer.

public string IconPath { get; set; }

Property Value

string

IsSystemSoundsSession

Is the session a system sounds session.

public bool IsSystemSoundsSession { get; }

Property Value

bool

SimpleAudioVolume

Simple audio volume of the audio session (for volume and mute status).

public SimpleAudioVolume SimpleAudioVolume { get; }

Property Value

SimpleAudioVolume

State

The current state of the audio session.

public AudioSessionState State { get; }

Property Value

AudioSessionState

Methods

Dispose()

Dispose

public void Dispose()

GetGroupingParam()

the grouping param for an audio session grouping

public Guid GetGroupingParam()

Returns

Guid

RegisterEventClient(IAudioSessionEventsHandler)

Registers an event client for callbacks. Multiple clients can be registered; registering a client that is already registered has no effect.

public void RegisterEventClient(IAudioSessionEventsHandler eventClient)

Parameters

eventClient IAudioSessionEventsHandler

The handler to register.

SetDuckingPreference(bool)

Enables or disables the default stream attenuation (auto-ducking) that the system applies to other audio streams when this is a communications session. By default Windows ducks other streams while a communications session is active; pass true to opt out so that other streams (for example separate communication devices) are not attenuated.

public void SetDuckingPreference(bool optOut)

Parameters

optOut bool

true to disable the system ducking experience for this session; false to use the default system ducking behaviour.

Remarks

Requires IAudioSessionControl2 (Windows 7 and later). Per the Windows SDK, this should be called before the session is made active.

SetGroupingParam(Guid, Guid)

For chanigng the grouping param and supplying the context of said change

public void SetGroupingParam(Guid groupingId, Guid context)

Parameters

groupingId Guid
context Guid

UnRegisterEventClient(IAudioSessionEventsHandler)

Unregisters an event client from receiving callbacks. Unregistering a client that is not registered has no effect.

public void UnRegisterEventClient(IAudioSessionEventsHandler eventClient)

Parameters

eventClient IAudioSessionEventsHandler

The handler to unregister.