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
DisplayName
The name of the audio session.
public string DisplayName { get; set; }
Property Value
GetProcessID
The process identifier of the audio session.
public uint GetProcessID { get; }
Property Value
GetSessionIdentifier
The session identifier of the audio session.
public string GetSessionIdentifier { get; }
Property Value
GetSessionInstanceIdentifier
The session instance identifier of the audio session.
public string GetSessionInstanceIdentifier { get; }
Property Value
IconPath
the path to the icon shown in the mixer.
public string IconPath { get; set; }
Property Value
IsSystemSoundsSession
Is the session a system sounds session.
public bool IsSystemSoundsSession { get; }
Property Value
SimpleAudioVolume
Simple audio volume of the audio session (for volume and mute status).
public SimpleAudioVolume SimpleAudioVolume { get; }
Property Value
State
The current state of the audio session.
public AudioSessionState State { get; }
Property Value
Methods
Dispose()
Dispose
public void Dispose()
GetGroupingParam()
the grouping param for an audio session grouping
public Guid GetGroupingParam()
Returns
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
eventClientIAudioSessionEventsHandlerThe 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
optOutbooltrueto disable the system ducking experience for this session;falseto 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
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
eventClientIAudioSessionEventsHandlerThe handler to unregister.