Wave Arts VQE  1.00
Voice Quality Enhancement
Public Member Functions | Protected Member Functions | Protected Attributes
AiffFileIn Class Reference

AIFF file reader. More...

#include <AiffFileIO.h>

Inheritance diagram for AiffFileIn:
AFileIn

List of all members.

Public Member Functions

 AiffFileIn (long cvtBufSizeArg=2048)
 Create AIFF file reader.
bool Open (char *fileName)
 Open file for reading.
long GetNumFrames ()
 Get the number of sample frames in file.
int GetNumChannels ()
 Get the number of audio channels.
int GetBitsPerSamp ()
 Get the number of bits per sample.
int GetSampSize ()
 Get the sample size in bytes.
int GetFrameSize ()
 Get the frame size in bytes.
long GetSampRate ()
 Get the sample rate.
long Tell ()
 Get current read position.
long Read (char *buf, long numBytes)
 Read raw data.
long ReadShortFrames (short *buf, long numFrames)
 Read 16-bit integer samples from file.
long ReadFloatFrames (float *buf, long numFrames)
 Read 32-bit float samples from file.
bool Seek (long frameOffset, int origin)
 Seek within samples.
bool Close ()
 Close file.

Protected Member Functions

bool Parse ()
 Parse the headers, return true if success.
bool CheckAudioFormat ()
 Check the audio format for compatibility, return true if success.

Protected Attributes

int numChannels
 number of channels
int numBitsPerSamp
 number of bits per sample
int sampSize
 sample size in bytes
int frameSize
 frame size in bytes
long sampRate
 sampling rate
long numFrames
 total number of sample frames in file
long curFrameIndex
 current frame read index
HAiff hAiff
 handle to Aiff

Detailed Description

AIFF file reader.

This class implements AIFF file reading.


Constructor & Destructor Documentation

AiffFileIn::AiffFileIn ( long  cvtBufSizeArg = 2048)

Create AIFF file reader.

Parameters:
cvtBufSizeArginternal conversion buffer size

Member Function Documentation

bool AiffFileIn::Open ( char *  fileName) [virtual]

Open file for reading.

Parameters:
[in]fileNamefile path to open

Open the file. Returns true if success, false if error.

Implements AFileIn.

long AiffFileIn::Read ( char *  buf,
long  numBytes 
) [virtual]

Read raw data.

Parameters:
[out]bufDestination buffer
[in]numBytesNumber of bytes to read

This method can be used to read raw sample data from file. Multi-channel data is read in interleaved format. Returns number of bytes read. The read is restricted to the data chunk of the file. This function is called internally, and users will probably prefer one of the other reader functions.

Implements AFileIn.

long AiffFileIn::ReadFloatFrames ( float *  buf,
long  numFrames 
) [virtual]

Read 32-bit float samples from file.

Parameters:
[out]bufDestination buffer
[in]numFramesNumber of frames to read

Read samples from file and convert to 32-bit floats in native format. Multi-channel data is read in interleaved format. Returns the number of sample frames read.

Implements AFileIn.

long AiffFileIn::ReadShortFrames ( short *  buf,
long  numFrames 
) [virtual]

Read 16-bit integer samples from file.

Parameters:
[out]bufDestination buffer
[in]numFramesNumber of frames to read

Read samples from file and convert to 16-bit integers in native format. Multi-channel data is read in interleaved format. Returns the number of sample frames read.

Implements AFileIn.

bool AiffFileIn::Seek ( long  frameOffset,
int  origin 
) [virtual]

Seek within samples.

Parameters:
[in]frameOffsetSample frame offset
[in]originseek origin (same as fseek)

Seek to sample frame offset within the data chunk of file. Returns true if success, false if error.

Implements AFileIn.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines