public class AudioSessionManager2 : AudioSessionManager
Enables an application to manage submixes for the audio device.
AudioSessionManager2(IntPtr ptr)
Initializes a new instance of the AudioSessionManager2 class.
public void AudioSessionManager2(IntPtr ptr)
Parameters
ptr
IntPtrThe native pointer.
Dispose(Boolean disposing)
Releases the COM object and unregisters all session notifications and all volume duck notifications.
FromMMDevice(MMDevice device)
Creates a new instance of AudioSessionManager2 based on a MMDevice.
public static AudioSessionManager2 FromMMDevice(MMDevice device)
Parameters
device
MMDeviceDevice 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.
RegisterDuckNotification(String sessionId, IAudioVolumeDuckNotification sessionNotification)
Registers the application to receive ducking notifications.
public void RegisterDuckNotification(String sessionId, IAudioVolumeDuckNotification sessionNotification)
Parameters
sessionId
StringA 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
IAudioVolumeDuckNotificationInstance of any object which implements the IAudioVolumeDuckNotification and which should receive duck notifications.
RegisterDuckNotificationNative(String sessionId, IAudioVolumeDuckNotification sessionNotification)
Registers the application to receive ducking notifications.
public Int32 RegisterDuckNotificationNative(String sessionId, IAudioVolumeDuckNotification sessionNotification)
Parameters
sessionId
StringA 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
IAudioVolumeDuckNotificationInstance 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
IAudioSessionNotificationThe 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
IAudioSessionNotificationThe 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
IAudioVolumeDuckNotificationThe 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
IAudioVolumeDuckNotificationThe 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
IAudioSessionNotificationThe 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
IAudioSessionNotificationThe 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