Table of Contents

Class AudioStreamVolume

Namespace
NAudio.CoreAudioApi
Assembly
NAudio.Wasapi.dll

Manages the AudioStreamVolume for the AudioClient.

public class AudioStreamVolume : IDisposable
Inheritance
AudioStreamVolume
Implements
Inherited Members

Properties

ChannelCount

Returns the current number of channels in this audio stream.

public int ChannelCount { get; }

Property Value

int

Methods

Dispose()

Dispose

public void Dispose()

GetAllVolumes()

Return the current stream volumes for all channels

public float[] GetAllVolumes()

Returns

float[]

An array of volume levels between 0.0 and 1.0 for each channel in the audio stream.

GetChannelVolume(int)

Return the current volume for the requested channel.

public float GetChannelVolume(int channelIndex)

Parameters

channelIndex int

The 0 based index into the channels.

Returns

float

The volume level for the channel between 0.0 and 1.0.

SetAllVolumes(float[])

Set the volume level for each channel of the audio stream.

public void SetAllVolumes(float[] levels)

Parameters

levels float[]

An array of volume levels (between 0.0 and 1.0) one for each channel.

Remarks

A volume level MUST be supplied for reach channel in the audio stream.

Exceptions

ArgumentOutOfRangeException

Thrown when levels does not contain ChannelCount elements.

SetChannelVolume(int, float)

Sets the volume level for one channel in the audio stream.

public void SetChannelVolume(int index, float level)

Parameters

index int

The 0-based index into the channels to adjust the volume of.

level float

The volume level between 0.0 and 1.0 for this channel of the audio stream.