Table of Contents

Interface IAudioSessionEvents

Namespace
NAudio.CoreAudioApi.Interfaces
Assembly
NAudio.Wasapi.dll

Windows CoreAudio IAudioSessionControl interface Defined in AudioPolicy.h

[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
[Guid("24918ACC-64B3-37C1-8CA9-74A66E9957A8")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[IUnknownDerived<InterfaceInformation, InterfaceImplementation>]
public interface IAudioSessionEvents

Methods

OnChannelVolumeChanged(uint, nint, uint, ref Guid)

Notifies the client that the volume level of an audio channel in the session submix has changed.

int OnChannelVolumeChanged(uint channelCount, nint newVolumes, uint channelIndex, ref Guid eventContext)

Parameters

channelCount uint

The channel count.

newVolumes nint

An array of volumnes cooresponding with each channel index.

channelIndex uint

The number of the channel whose volume level changed.

eventContext Guid

A user context value that is passed to the notification callback.

Returns

int

An HRESULT code indicating whether the operation succeeded of failed.

OnDisplayNameChanged(string, ref Guid)

Notifies the client that the display name for the session has changed.

int OnDisplayNameChanged(string displayName, ref Guid eventContext)

Parameters

displayName string

The new display name for the session.

eventContext Guid

A user context value that is passed to the notification callback.

Returns

int

An HRESULT code indicating whether the operation succeeded of failed.

OnGroupingParamChanged(ref Guid, ref Guid)

Notifies the client that the grouping parameter for the session has changed.

int OnGroupingParamChanged(ref Guid groupingId, ref Guid eventContext)

Parameters

groupingId Guid

The new grouping parameter for the session.

eventContext Guid

A user context value that is passed to the notification callback.

Returns

int

An HRESULT code indicating whether the operation succeeded of failed.

OnIconPathChanged(string, ref Guid)

Notifies the client that the display icon for the session has changed.

int OnIconPathChanged(string iconPath, ref Guid eventContext)

Parameters

iconPath string

The path for the new display icon for the session.

eventContext Guid

A user context value that is passed to the notification callback.

Returns

int

An HRESULT code indicating whether the operation succeeded of failed.

OnSessionDisconnected(AudioSessionDisconnectReason)

Notifies the client that the session has been disconnected.

int OnSessionDisconnected(AudioSessionDisconnectReason disconnectReason)

Parameters

disconnectReason AudioSessionDisconnectReason

The reason that the audio session was disconnected.

Returns

int

An HRESULT code indicating whether the operation succeeded of failed.

OnSimpleVolumeChanged(float, int, ref Guid)

Notifies the client that the volume level or muting state of the session has changed.

int OnSimpleVolumeChanged(float volume, int isMuted, ref Guid eventContext)

Parameters

volume float

The new volume level for the audio session.

isMuted int

The new muting state (Win32 BOOL — 0 or non-zero).

eventContext Guid

A user context value that is passed to the notification callback.

Returns

int

An HRESULT code indicating whether the operation succeeded of failed.

OnStateChanged(AudioSessionState)

Notifies the client that the stream-activity state of the session has changed.

int OnStateChanged(AudioSessionState state)

Parameters

state AudioSessionState

The new session state.

Returns

int

An HRESULT code indicating whether the operation succeeded of failed.