public class SimpleAudioVolume : ComObject
The SimpleAudioVolume object enables a client to control the master volume level of an audio session. For more information, see .
SimpleAudioVolume(IntPtr nativePtr)
Initializes a new instance of the SimpleAudioVolume class.
public void SimpleAudioVolume(IntPtr nativePtr)
Parameters
nativePtr
IntPtrThe native pointer of the COM object.
FromAudioClient(AudioClient audioClient)
Creates a new SimpleAudioVolume instance by calling the GetService method of the specified audioClient.
public static SimpleAudioVolume FromAudioClient(AudioClient audioClient)
Parameters
audioClient
AudioClientThe AudioClient which should be used to create the SimpleAudioVolume-instance with.
Returns
A new instance of the SimpleAudioVolume class.
GetMasterVolumeNative(Single& volume)
Retrieves the client volume level for the audio session.
public Int32 GetMasterVolumeNative(Single& volume)
Parameters
volume
Single&A variable into which the method writes the client volume level. The volume level is a value in the range 0.0 to 1.0.
Returns
HRESULT
GetMuteInternal(NativeBool& isMuted)
The GetMute method retrieves the current muting state for the audio session.
public Int32 GetMuteInternal(NativeBool& isMuted)
Parameters
isMuted
NativeBool&A variable into which the method writes the muting state. TRUE indicates that muting is enabled. FALSE indicates that it is disabled.
Returns
HRESULT
SetMasterVolumeNative(Single volume, Guid eventContext)
Sets the master volume level for the audio session.
public Int32 SetMasterVolumeNative(Single volume, Guid eventContext)
Parameters
volume
SingleThe new master volume level. Valid volume levels are in the range 0.0 to 1.0.
eventContext
GuidEventContext which can be accessed in the event handler.
Returns
HRESULT
SetMuteNative(NativeBool muted, Guid eventContext)
Sets the muting state for the audio session.
public Int32 SetMuteNative(NativeBool muted, Guid eventContext)
Parameters
muted
NativeBoolThe new muting state. TRUE enables muting. FALSE disables muting.
eventContext
GuidEventContext which can be accessed in the event handler.
Returns
HRESULT
IsMuted
Gets or sets the muting state for the audio session. True indicates that muting is enabled. False indicates that it is disabled.
public Boolean IsMuted { get; set; }
MasterVolume
Gets or sets the master volume level for the audio session. Valid volume levels are in the range 0.0 (=0%) to 1.0 (=100%).
public Single MasterVolume { get; set; }