Class AiffFileReader
A read-only stream of AIFF data based on an aiff file with an associated WaveFormat originally contributed to NAudio by Giawa
public class AiffFileReader : WaveStream, IDisposable, IAsyncDisposable, IWaveProvider
- Inheritance
-
AiffFileReader
- Implements
- Inherited Members
- Extension Methods
Constructors
AiffFileReader(Stream)
Creates an Aiff File Reader based on an input stream
public AiffFileReader(Stream inputStream)
Parameters
inputStream
StreamThe input stream containing a AIF file including header
AiffFileReader(string)
Supports opening a AIF file
public AiffFileReader(string aiffFile)
Parameters
aiffFile
string
Remarks
The AIF is of similar nastiness to the WAV format. This supports basic reading of uncompressed PCM AIF files, with 8, 16, 24 and 32 bit PCM data.
Properties
Length
public override long Length { get; }
Property Value
Position
Position in the AIFF file Position
public override long Position { get; set; }
Property Value
SampleCount
Number of Samples (if possible to calculate)
public long SampleCount { get; }
Property Value
WaveFormat
public override WaveFormat WaveFormat { get; }
Property Value
Methods
Dispose(bool)
Cleans up the resources associated with this AiffFileReader
protected override void Dispose(bool disposing)
Parameters
disposing
bool
Read(byte[], int, int)
Reads bytes from the AIFF File Read(byte[], int, int)
public override int Read(byte[] array, int offset, int count)
Parameters
Returns
ReadAiffHeader(Stream, out WaveFormat, out long, out int, List<AiffChunk>)
Ensures valid AIFF header and then finds data offset.
public static void ReadAiffHeader(Stream stream, out WaveFormat format, out long dataChunkPosition, out int dataChunkLength, List<AiffFileReader.AiffChunk> chunks)
Parameters
stream
StreamThe stream, positioned at the start of audio data
format
WaveFormatThe format found
dataChunkPosition
longThe position of the data chunk
dataChunkLength
intThe length of the data chunk
chunks
List<AiffFileReader.AiffChunk>Additional chunks found