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

Converts IEEE float to 16 bit PCM, optionally clipping and adjusting volume along the way. More...

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

Public Member Functions

 WaveFloatTo16Provider (IWaveProvider sourceProvider)
 Creates a new WaveFloatTo16Provider.
 
int Read (byte[] destBuffer, int offset, int numBytes)
 Reads audio data from the source buffer, adjusts the volume, clips the samples, and writes the result to the destination buffer.
 

Properties

WaveFormat WaveFormat [get]
 IWaveProvider.WaveFormat
 
float Volume [get, set]
 Volume of this channel. 1.0 = full scale.
 
- Properties inherited from NAudio.Wave.IWaveProvider

Private Attributes

readonly IWaveProvider sourceProvider
 
readonly WaveFormat waveFormat
 
volatile float volume
 
byte[] sourceBuffer
 

Detailed Description

Converts IEEE float to 16 bit PCM, optionally clipping and adjusting volume along the way.

Constructor & Destructor Documentation

◆ WaveFloatTo16Provider()

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

Creates a new WaveFloatTo16Provider.

Parameters
sourceProviderthe source provider

Member Function Documentation

◆ Read()

int NAudio.Wave.WaveFloatTo16Provider.Read ( byte[] destBuffer,
int offset,
int numBytes )
inline

Reads audio data from the source buffer, adjusts the volume, clips the samples, and writes the result to the destination buffer.

Parameters
destBufferThe destination buffer to write the audio data to.
offsetThe offset in the destination buffer at which to start writing.
numBytesThe number of bytes to read from the source buffer and write to the destination buffer.
Returns
The number of bytes written to the destination buffer.

This method reads audio data from the source buffer, adjusts the volume of each sample, clips the samples to prevent overflow, and writes the result to the destination buffer. The method modifies the destination buffer in place.

Implements NAudio.Wave.IWaveProvider.

Here is the call graph for this function:

Member Data Documentation

◆ sourceBuffer

byte [] NAudio.Wave.WaveFloatTo16Provider.sourceBuffer
private

◆ sourceProvider

readonly IWaveProvider NAudio.Wave.WaveFloatTo16Provider.sourceProvider
private

◆ volume

volatile float NAudio.Wave.WaveFloatTo16Provider.volume
private

◆ waveFormat

readonly WaveFormat NAudio.Wave.WaveFloatTo16Provider.waveFormat
private

Property Documentation

◆ Volume

float NAudio.Wave.WaveFloatTo16Provider.Volume
getset

Volume of this channel. 1.0 = full scale.

◆ WaveFormat

WaveFormat NAudio.Wave.WaveFloatTo16Provider.WaveFormat
get

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