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

Provides a buffered store of samples Read method will return queued samples or fill buffer with zeroes Now backed by a circular buffer. More...

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

Public Member Functions

 BufferedWaveProvider (WaveFormat waveFormat)
 Creates a new buffered WaveProvider.
 
void AddSamples (byte[] buffer, int offset, int count)
 Adds the specified samples to the circular buffer.
 
int Read (byte[] buffer, int offset, int count)
 Reads data from the circular buffer into the specified byte array.
 
void ClearBuffer ()
 Clears the circular buffer.
 

Properties

bool ReadFully [get, set]
 If true, always read the amount of data requested, padding with zeroes if necessary By default is set to true.
 
int BufferLength [get, set]
 Buffer length in bytes.
 
TimeSpan BufferDuration [get, set]
 Buffer duration.
 
bool DiscardOnBufferOverflow [get, set]
 If true, when the buffer is full, start throwing away data if false, AddSamples will throw an exception when buffer is full.
 
int BufferedBytes [get]
 The number of buffered bytes.
 
TimeSpan BufferedDuration [get]
 Buffered Duration.
 
WaveFormat WaveFormat [get]
 Gets the WaveFormat.
 
- Properties inherited from NAudio.Wave.IWaveProvider

Private Attributes

CircularBuffer circularBuffer
 
readonly WaveFormat waveFormat
 

Detailed Description

Provides a buffered store of samples Read method will return queued samples or fill buffer with zeroes Now backed by a circular buffer.

Constructor & Destructor Documentation

◆ BufferedWaveProvider()

NAudio.Wave.BufferedWaveProvider.BufferedWaveProvider ( WaveFormat waveFormat)
inline

Creates a new buffered WaveProvider.

Parameters
waveFormatWaveFormat

Member Function Documentation

◆ AddSamples()

void NAudio.Wave.BufferedWaveProvider.AddSamples ( byte[] buffer,
int offset,
int count )
inline

Adds the specified samples to the circular buffer.

Parameters
bufferThe buffer containing the samples to be added.
offsetThe zero-based byte offset in the buffer at which to begin copying bytes to the circular buffer.
countThe number of samples to be added from the buffer to the circular buffer.
Exceptions
InvalidOperationExceptionThrown when the circular buffer is full and DiscardOnBufferOverflow is set to false.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClearBuffer()

void NAudio.Wave.BufferedWaveProvider.ClearBuffer ( )
inline

Clears the circular buffer.

This method clears the circular buffer by resetting it to its initial state.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Read()

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

Reads data from the circular buffer into the specified byte array.

Parameters
bufferThe byte array to read the 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 circular buffer into the specified byte array starting at the specified offset and up to the specified count. If the circular buffer is not yet created, it returns 0. If ReadFully is true and the total number of bytes read is less than the specified count, it zeros the end of the buffer and returns the total count.

Implements NAudio.Wave.IWaveProvider.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ circularBuffer

CircularBuffer NAudio.Wave.BufferedWaveProvider.circularBuffer
private

◆ waveFormat

readonly WaveFormat NAudio.Wave.BufferedWaveProvider.waveFormat
private

Property Documentation

◆ BufferDuration

TimeSpan NAudio.Wave.BufferedWaveProvider.BufferDuration
getset

Buffer duration.

◆ BufferedBytes

int NAudio.Wave.BufferedWaveProvider.BufferedBytes
get

The number of buffered bytes.

◆ BufferedDuration

TimeSpan NAudio.Wave.BufferedWaveProvider.BufferedDuration
get

Buffered Duration.

◆ BufferLength

int NAudio.Wave.BufferedWaveProvider.BufferLength
getset

Buffer length in bytes.

◆ DiscardOnBufferOverflow

bool NAudio.Wave.BufferedWaveProvider.DiscardOnBufferOverflow
getset

If true, when the buffer is full, start throwing away data if false, AddSamples will throw an exception when buffer is full.

◆ ReadFully

bool NAudio.Wave.BufferedWaveProvider.ReadFully
getset

If true, always read the amount of data requested, padding with zeroes if necessary By default is set to true.

◆ WaveFormat

WaveFormat NAudio.Wave.BufferedWaveProvider.WaveFormat
get

Gets the WaveFormat.

Implements NAudio.Wave.IWaveProvider.


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