Table of Contents

Class WaveStream

Namespace
NAudio.Wave
Assembly
NAudio.Core.dll

Base class for all WaveStream classes. Derives from stream.

public abstract class WaveStream : Stream, IDisposable, IAsyncDisposable, IWaveProvider
Inheritance
WaveStream
Implements
Derived
Inherited Members
Extension Methods

Constructors

WaveStream()

protected WaveStream()

Properties

BlockAlign

The block alignment for this wavestream. Do not modify the Position to anything that is not a whole multiple of this value

public virtual int BlockAlign { get; }

Property Value

int

CanRead

We can read from this stream

public override bool CanRead { get; }

Property Value

bool

CanSeek

We can seek within this stream

public override bool CanSeek { get; }

Property Value

bool

CanWrite

We can't write to this stream

public override bool CanWrite { get; }

Property Value

bool

CurrentTime

The current position in the stream in Time format

public virtual TimeSpan CurrentTime { get; set; }

Property Value

TimeSpan

TotalTime

Total length in real-time of the stream (may be an estimate for compressed files)

public virtual TimeSpan TotalTime { get; }

Property Value

TimeSpan

WaveFormat

Retrieves the WaveFormat for this stream

public abstract WaveFormat WaveFormat { get; }

Property Value

WaveFormat

Methods

Flush()

Flush does not need to do anything See Flush()

public override void Flush()

HasData(int)

Whether the WaveStream has non-zero sample data at the current position for the specified count

public virtual bool HasData(int count)

Parameters

count int

Number of bytes to read

Returns

bool

Seek(long, SeekOrigin)

An alternative way of repositioning. See Seek(long, SeekOrigin)

public override long Seek(long offset, SeekOrigin origin)

Parameters

offset long
origin SeekOrigin

Returns

long

SetLength(long)

Sets the length of the WaveStream. Not Supported.

public override void SetLength(long length)

Parameters

length long

Skip(int)

Moves forward or backwards the specified number of seconds in the stream

public void Skip(int seconds)

Parameters

seconds int

Number of seconds to move, can be negative

Write(byte[], int, int)

Writes to the WaveStream. Not Supported.

public override void Write(byte[] buffer, int offset, int count)

Parameters

buffer byte[]
offset int
count int