Halyri - Häke  0.9.1
 All Classes Namespaces Functions Variables Enumerations Properties
BufferWaveStream Class Reference

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.

Public Member Functions

 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...
 

Properties

override WaveFormat WaveFormat [get]
 
override long Length [get]
 
override long Position [get, set]
 

Detailed Description

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>

Constructor & Destructor Documentation

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.

Parameters
sampleRateSample rate im samples per second
bytesPerSamplebytes per PCM sample
channelsNumber of channels

Member Function Documentation

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
bufferBuffer to which the data is copied to
offsetOffset for the data at the target buffer
countDesired 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
bufferBytes to write
offsetOffset at which the bytes to write start
countCount of the bytes to write<param>

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