Methods (6) Properties (2)
Namespace: CSCore.CoreAudioAPI

Syntax

public class SimpleAudioVolume : ComObject

Base Type

Summary

The SimpleAudioVolume object enables a client to control the master volume level of an audio session. For more information, see .

Uses

Methods

SimpleAudioVolume(IntPtr nativePtr)

Initializes a new instance of the SimpleAudioVolume class.

public void SimpleAudioVolume(IntPtr nativePtr)

Parameters

nativePtr

IntPtr

The 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

AudioClient

The AudioClient which should be used to create the SimpleAudioVolume-instance with.

Returns

A new instance of the SimpleAudioVolume class.

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom

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

Single

The new master volume level. Valid volume levels are in the range 0.0 to 1.0.

eventContext

Guid

EventContext 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

NativeBool

The new muting state. TRUE enables muting. FALSE disables muting.

eventContext

Guid

EventContext which can be accessed in the event handler.

Returns

HRESULT

Properties

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; }