Xeno-rat
Loading...
Searching...
No Matches
NAudio.Wave.VolumeWaveProvider16 Class Reference

Helper class allowing us to modify the volume of a 16 bit stream without converting to IEEE float. More...

Inheritance diagram for NAudio.Wave.VolumeWaveProvider16:
Collaboration diagram for NAudio.Wave.VolumeWaveProvider16:

Public Member Functions

 VolumeWaveProvider16 (IWaveProvider sourceProvider)
 Constructs a new VolumeWaveProvider16.
 
int Read (byte[] buffer, int offset, int count)
 Reads data from the source provider into the buffer and applies volume adjustments if necessary.
 

Properties

float Volume [get, set]
 Gets or sets volume. 1.0 is full scale, 0.0 is silence, anything over 1.0 will amplify but potentially clip.
 
WaveFormat WaveFormat [get]
 WaveFormat of this WaveProvider.
 
- Properties inherited from NAudio.Wave.IWaveProvider

Private Attributes

readonly IWaveProvider sourceProvider
 
float volume
 

Detailed Description

Helper class allowing us to modify the volume of a 16 bit stream without converting to IEEE float.

Constructor & Destructor Documentation

◆ VolumeWaveProvider16()

NAudio.Wave.VolumeWaveProvider16.VolumeWaveProvider16 ( IWaveProvider sourceProvider)
inline

Constructs a new VolumeWaveProvider16.

Parameters
sourceProviderSource provider, must be 16 bit PCM

Member Function Documentation

◆ Read()

int NAudio.Wave.VolumeWaveProvider16.Read ( byte[] buffer,
int offset,
int count )
inline

Reads data from the source provider into the buffer and applies volume adjustments if necessary.

Parameters
bufferThe buffer to read data into.
offsetThe zero-based byte offset in buffer at which to begin storing the data read from the current stream.
countThe maximum number of bytes to read.
Returns
The total number of bytes read into the buffer.

This method reads data from the source provider into the buffer, and if the volume is not 1.0f, it applies volume adjustments to the samples in the buffer. If the volume is 0.0f, it fills the buffer with zeros.

Implements NAudio.Wave.IWaveProvider.

Here is the call graph for this function:

Member Data Documentation

◆ sourceProvider

readonly IWaveProvider NAudio.Wave.VolumeWaveProvider16.sourceProvider
private

◆ volume

float NAudio.Wave.VolumeWaveProvider16.volume
private

Property Documentation

◆ Volume

float NAudio.Wave.VolumeWaveProvider16.Volume
getset

Gets or sets volume. 1.0 is full scale, 0.0 is silence, anything over 1.0 will amplify but potentially clip.

◆ WaveFormat

WaveFormat NAudio.Wave.VolumeWaveProvider16.WaveFormat
get

WaveFormat of this WaveProvider.

Implements NAudio.Wave.IWaveProvider.


The documentation for this class was generated from the following file: