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

WaveStream that simply passes on data from its source stream (e.g. a MemoryStream) More...

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

Public Member Functions

 RawSourceWaveStream (Stream sourceStream, WaveFormat waveFormat)
 Initialises a new instance of RawSourceWaveStream.
 
 RawSourceWaveStream (byte[] byteStream, int offset, int count, WaveFormat waveFormat)
 Initialises a new instance of RawSourceWaveStream.
 
override int Read (byte[] buffer, int offset, int count)
 Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
 
- Public Member Functions inherited from NAudio.Wave.WaveStream
override void Flush ()
 Flushes the buffer of the current stream and causes any buffered data to be written to the underlying device.
 
override long Seek (long offset, SeekOrigin origin)
 Sets the position within the current stream.
 
override void SetLength (long length)
 Throws a NotSupportedException with the message "Can't set length of a WaveFormatString".
 
override void Write (byte[] buffer, int offset, int count)
 Throws a NotSupportedException with the message "Can't write to a WaveFormatString".
 
void Skip (int seconds)
 Skips the playback to a new position in the audio file based on the specified number of seconds.
 
virtual bool HasData (int count)
 Checks if there is data available at the current position.
 

Properties

override WaveFormat WaveFormat [get]
 The WaveFormat of this stream.
 
override long Length [get]
 The length in bytes of this stream (if supported)
 
override long Position [get, set]
 The current position in this stream.
 
- Properties inherited from NAudio.Wave.WaveStream
WaveFormat WaveFormat [get]
 Retrieves the WaveFormat for this stream.
 
override bool CanRead [get]
 We can read from this stream.
 
override bool CanSeek [get]
 We can seek within this stream.
 
override bool CanWrite [get]
 We can't write to this stream.
 
virtual int BlockAlign [get]
 The block alignment for this wavestream. Do not modify the Position to anything that is not a whole multiple of this value.
 
virtual TimeSpan CurrentTime [get, set]
 The current position in the stream in Time format.
 
virtual TimeSpan TotalTime [get]
 Total length in real-time of the stream (may be an estimate for compressed files)
 
- Properties inherited from NAudio.Wave.IWaveProvider

Private Attributes

readonly Stream sourceStream
 
readonly WaveFormat waveFormat
 

Detailed Description

WaveStream that simply passes on data from its source stream (e.g. a MemoryStream)

Constructor & Destructor Documentation

◆ RawSourceWaveStream() [1/2]

NAudio.Wave.RawSourceWaveStream.RawSourceWaveStream ( Stream sourceStream,
WaveFormat waveFormat )
inline

Initialises a new instance of RawSourceWaveStream.

Parameters
sourceStreamThe source stream containing raw audio
waveFormatThe waveformat of the audio in the source stream

◆ RawSourceWaveStream() [2/2]

NAudio.Wave.RawSourceWaveStream.RawSourceWaveStream ( byte[] byteStream,
int offset,
int count,
WaveFormat waveFormat )
inline

Initialises a new instance of RawSourceWaveStream.

Parameters
byteStreamThe buffer containing raw audio
offsetOffset in the source buffer to read from
countNumber of bytes to read in the buffer
waveFormatThe waveformat of the audio in the source stream

Member Function Documentation

◆ Read()

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

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

Parameters
bufferAn array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.
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 be read from the current stream.
Returns
The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero if the end of the stream is reached before any bytes are read.
Exceptions
EndOfStreamExceptionThe end of the stream is reached.

Implements NAudio.Wave.IWaveProvider.

Member Data Documentation

◆ sourceStream

readonly Stream NAudio.Wave.RawSourceWaveStream.sourceStream
private

◆ waveFormat

readonly WaveFormat NAudio.Wave.RawSourceWaveStream.waveFormat
private

Property Documentation

◆ Length

override long NAudio.Wave.RawSourceWaveStream.Length
get

The length in bytes of this stream (if supported)

◆ Position

override long NAudio.Wave.RawSourceWaveStream.Position
getset

The current position in this stream.

◆ WaveFormat

override WaveFormat NAudio.Wave.RawSourceWaveStream.WaveFormat
get

The WaveFormat of this stream.

Implements NAudio.Wave.IWaveProvider.


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