Methods (13)
Namespace: CSCore.CoreAudioAPI

Syntax

public class AudioSessionManager2 : AudioSessionManager

Base Type

Summary

Enables an application to manage submixes for the audio device.

Uses

Methods

AudioSessionManager2(IntPtr ptr)

Initializes a new instance of the AudioSessionManager2 class.

public void AudioSessionManager2(IntPtr ptr)

Parameters

ptr

IntPtr

The native pointer.

Dispose(Boolean disposing)

Releases the COM object and unregisters all session notifications and all volume duck notifications.

protected void Dispose(Boolean disposing)

Parameters

disposing

Boolean

True to release both managed and unmanaged resources; false to release only unmanaged resources.

CSCore.CoreAudioAPI.AudioSessionManager2CSCore.Win32.ComObjectDisposefor (int i = _sessionNotifications.Count - 1; i >= 0; i--)UnregisterSessionNotificationendfor (int i = _volumeDuckNotifications.Count - 1; i >= 0; i--)UnregisterDuckNotificationendDispose

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom

FromMMDevice(MMDevice device)

Creates a new instance of AudioSessionManager2 based on a MMDevice.

public static AudioSessionManager2 FromMMDevice(MMDevice device)

Parameters

device

MMDevice

Device to use to activate the AudioSessionManager2.

Returns

AudioSessionManager2 instance for the specified device.

GetSessionEnumerator()

Gets a pointer to the audio session enumerator object.

public AudioSessionEnumerator GetSessionEnumerator()

Returns

a session enumerator object that the client can use to enumerate audio sessions on the audio device.

Remarks

The client is responsible for releasing the returned AudioSessionEnumerator.

GetSessionEnumeratorNative(AudioSessionEnumerator& sessionEnumerator)

Gets a pointer to the audio session enumerator object.

public Int32 GetSessionEnumeratorNative(AudioSessionEnumerator& sessionEnumerator)

Parameters

sessionEnumerator

AudioSessionEnumerator&

Retrieves a session enumerator object that the client can use to enumerate audio sessions on the audio device.

Returns

HRESULT

Remarks

The client is responsible for releasing the sessionEnumerator.

public void RegisterDuckNotification(String sessionId, IAudioVolumeDuckNotification sessionNotification)

Parameters

sessionId

String

A string that contains a session instance identifier. Applications that are playing a media stream and want to provide custom stream attenuation or ducking behavior, pass their own session instance identifier. Other applications that do not want to alter their streams but want to get all the ducking notifications must pass NULL.

sessionNotification

IAudioVolumeDuckNotification

Instance of any object which implements the IAudioVolumeDuckNotification and which should receive duck notifications.

public Int32 RegisterDuckNotificationNative(String sessionId, IAudioVolumeDuckNotification sessionNotification)

Parameters

sessionId

String

A string that contains a session instance identifier. Applications that are playing a media stream and want to provide custom stream attenuation or ducking behavior, pass their own session instance identifier. Other applications that do not want to alter their streams but want to get all the ducking notifications must pass NULL.

sessionNotification

IAudioVolumeDuckNotification

Instance of any object which implements the IAudioVolumeDuckNotification and which should receive duck notifications.

Returns

HRESULT

RegisterSessionNotification(IAudioSessionNotification sessionNotification)

Registers the application to receive a notification when a session is created.

public void RegisterSessionNotification(IAudioSessionNotification sessionNotification)

Parameters

sessionNotification

IAudioSessionNotification

The application's implementation of the IAudioSessionNotification interface.

Remarks

Use the AudioSessionNotification class as the default implementation for the sessionNotification parameter.

Note: Make sure to call the RegisterSessionNotification from an MTA-Thread. Also make sure to enumerate all sessions after calling this method.

RegisterSessionNotificationNative(IAudioSessionNotification sessionNotification)

Registers the application to receive a notification when a session is created.

public Int32 RegisterSessionNotificationNative(IAudioSessionNotification sessionNotification)

Parameters

sessionNotification

IAudioSessionNotification

The application's implementation of the IAudioSessionNotification interface.

Returns

HRESULT

Remarks

Use the AudioSessionNotification class as the default implementation for the sessionNotification parameter.

Note: Make sure to call the RegisterSessionNotificationNative from an MTA-Thread. Also make sure to enumerate all sessions after calling this method.

UnregisterDuckNotification(IAudioVolumeDuckNotification sessionNotification)

Deletes the registration to receive ducking notifications.

public void UnregisterDuckNotification(IAudioVolumeDuckNotification sessionNotification)

Parameters

sessionNotification

IAudioVolumeDuckNotification

The IAudioVolumeDuckNotification interface that is implemented by the application. Pass the same interface pointer that was specified to the session manager in a previous call to the RegisterDuckNotification method.

UnregisterDuckNotificationNative(IAudioVolumeDuckNotification sessionNotification)

Deletes the registration to receive ducking notifications.

public Int32 UnregisterDuckNotificationNative(IAudioVolumeDuckNotification sessionNotification)

Parameters

sessionNotification

IAudioVolumeDuckNotification

The IAudioVolumeDuckNotification interface that is implemented by the application. Pass the same interface pointer that was specified to the session manager in a previous call to the RegisterDuckNotification method.

Returns

HRESULT

UnregisterSessionNotification(IAudioSessionNotification sessionNotification)

Deletes the registration to receive a notification when a session is created.

public void UnregisterSessionNotification(IAudioSessionNotification sessionNotification)

Parameters

sessionNotification

IAudioSessionNotification

The application's implementation of the IAudioSessionNotification interface. Pass the same object that was specified to the session manager in a previous call RegisterSessionNotification to register for notification.

UnregisterSessionNotificationNative(IAudioSessionNotification sessionNotification)

Deletes the registration to receive a notification when a session is created.

public Int32 UnregisterSessionNotificationNative(IAudioSessionNotification sessionNotification)

Parameters

sessionNotification

IAudioSessionNotification

The application's implementation of the IAudioSessionNotification interface. Pass the same object that was specified to the session manager in a previous call RegisterSessionNotification to register for notification.

Returns

HRESULT