Provides a buffered store of samples Read method will return queued samples or fill buffer with zeroes Now backed by a circular buffer.
More...
|
| 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.
|
|
|
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.
|
|
Provides a buffered store of samples Read method will return queued samples or fill buffer with zeroes Now backed by a circular buffer.
◆ BufferedWaveProvider()
NAudio.Wave.BufferedWaveProvider.BufferedWaveProvider |
( |
WaveFormat | waveFormat | ) |
|
|
inline |
Creates a new buffered WaveProvider.
- Parameters
-
◆ AddSamples()
void NAudio.Wave.BufferedWaveProvider.AddSamples |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count ) |
|
inline |
Adds the specified samples to the circular buffer.
- Parameters
-
buffer | The buffer containing the samples to be added. |
offset | The zero-based byte offset in the buffer at which to begin copying bytes to the circular buffer. |
count | The number of samples to be added from the buffer to the circular buffer. |
- Exceptions
-
InvalidOperationException | Thrown when the circular buffer is full and DiscardOnBufferOverflow is set to false. |
◆ ClearBuffer()
void NAudio.Wave.BufferedWaveProvider.ClearBuffer |
( |
| ) |
|
|
inline |
Clears the circular buffer.
This method clears the circular buffer by resetting it to its initial state.
◆ 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
-
buffer | The byte array to read the data into. |
offset | The zero-based byte offset in buffer at which to begin storing the data read from the current stream. |
count | The 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.
◆ circularBuffer
◆ waveFormat
readonly WaveFormat NAudio.Wave.BufferedWaveProvider.waveFormat |
|
private |
◆ BufferDuration
TimeSpan NAudio.Wave.BufferedWaveProvider.BufferDuration |
|
getset |
◆ BufferedBytes
int NAudio.Wave.BufferedWaveProvider.BufferedBytes |
|
get |
The number of buffered bytes.
◆ BufferedDuration
TimeSpan NAudio.Wave.BufferedWaveProvider.BufferedDuration |
|
get |
◆ BufferLength
int NAudio.Wave.BufferedWaveProvider.BufferLength |
|
getset |
◆ 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 |
The documentation for this class was generated from the following file:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/Plugins/LiveMicrophone/lib/NAudio.Core/Wave/WaveProviders/BufferedWaveProvider.cs