Table of Contents

Method SetChannelGain

Namespace
Bonsai.Mixer
Assembly
Bonsai.Mixer.dll

SetChannelGain(float[], double)

Sets the per-channel gain of the source to a separate level for each output channel over the specified duration.

public void SetChannelGain(float[] values, double duration)

Parameters

values float[]

The gain level for each output channel, where 1 represents the original signal amplitude. The number of values must be equal to the number of channels.

duration double

The length of the gain ramp, in seconds. A duration of zero changes the gain immediately.

Remarks

The per-channel gain is independent of the source gain. The effective gain applied to a channel is the product of the source gain and the per-channel gain for that channel.

Exceptions

ArgumentNullException

The array of values is null.

ArgumentException

The number of values is not equal to the number of channels.