Provides a NAudio WaveStream with infinite length to facilitate streaming audio playback. Contains an internal buffer for the audio samples. If the buffer is empty, all read requests will return the desired length of silence. If there is pcm audio available in the buffer, it will be returned to the reader, possibly padded with silence to meet the desired read length.
More...
Inherits WaveStream.
|
| BufferWaveStream (int sampleRate, int bytesPerSample, int channels) |
| Initializes a new BufferWaveStream that has a WaveFormat defined by the provided parameters. The audio buffer is empty and has no length limit. More...
|
|
override void | Write (byte[] buffer, int offset, int count) |
| Writes the provided audio data to the outgoing PCM segment buffer. More...
|
|
override int | Read (byte[] buffer, int offset, int count) |
| Reads PCM samples from the underlying buffer. If no data is available, returns silent simples. More...
|
|
|
override WaveFormat | WaveFormat [get] |
|
override long | Length [get] |
|
override long | Position [get, set] |
|
Provides a NAudio WaveStream with infinite length to facilitate streaming audio playback. Contains an internal buffer for the audio samples. If the buffer is empty, all read requests will return the desired length of silence. If there is pcm audio available in the buffer, it will be returned to the reader, possibly padded with silence to meet the desired read length.
<author>Veli-Mikko Puupponen</author>
Initializes a new BufferWaveStream that has a WaveFormat defined by the provided parameters. The audio buffer is empty and has no length limit.
- Parameters
-
sampleRate | Sample rate im samples per second |
bytesPerSample | bytes per PCM sample |
channels | Number of channels |
override int Read |
( |
byte[] |
buffer, |
|
|
int |
offset, |
|
|
int |
count |
|
) |
| |
Reads PCM samples from the underlying buffer. If no data is available, returns silent simples.
- Parameters
-
buffer | Buffer to which the data is copied to |
offset | Offset for the data at the target buffer |
count | Desired count of data |
- Returns
override void Write |
( |
byte[] |
buffer, |
|
|
int |
offset, |
|
|
int |
count |
|
) |
| |
Writes the provided audio data to the outgoing PCM segment buffer.
- Parameters
-
buffer | Bytes to write |
offset | Offset at which the bytes to write start |
count | Count of the bytes to write<param> |
The documentation for this class was generated from the following file: