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

Audio file input via memory buffer. More...

#include <AMemFileIO.h>

Inheritance diagram for AMemFileIn:
AFileIn

List of all members.

Public Member Functions

 AMemFileIn (AFileIn *afi)
virtual void SetErrorText (char *str)
 Set the error text.
virtual char * GetErrorText ()
 Get the error text, useful for displays if methods return error status.
virtual bool IsFileOpen ()
 Return T/F if file is currently open.
virtual AFileIOType GetType ()
 Return the type of the file.
virtual bool Open (char *fileName)
 Open file for reading.
virtual long GetNumFrames ()
 Get the number of sample frames in file.
virtual int GetNumChannels ()
 Get the number of audio channels.
virtual int GetBitsPerSamp ()
 Get the number of bits per sample.
virtual int GetSampSize ()
 Get the sample size in bytes.
virtual int GetFrameSize ()
 Get the frame size in bytes.
virtual long GetSampRate ()
 Get the sample rate.
virtual long Read (char *buf, long numBytes)
 Read raw data.
virtual long ReadShortFrames (short *buf, long numFrames)
 Read 16-bit integer samples from file.
virtual long ReadFloatFrames (float *buf, long numFrames)
 Read 32-bit float samples from file.
virtual bool Seek (long frameOffset, int origin)
 Seek within samples.
virtual bool Close ()
 Close file.

Protected Attributes

AFileInafi
 actual file input
short * memBuf
 buffer of samples
int numChan
 number channels (samples per frame)
long memLen
 length in frames
long memIndex
 read index in frames

Detailed Description

Audio file input via memory buffer.


Member Function Documentation

bool AMemFileIn::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 AMemFileIn::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 AMemFileIn::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 AMemFileIn::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 AMemFileIn::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