|
Wave Arts VQE
1.00
Voice Quality Enhancement
|
Audio file input via memory buffer. More...
#include <AMemFileIO.h>
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 | |
| AFileIn * | afi |
| 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 | |
Audio file input via memory buffer.
| bool AMemFileIn::Open | ( | char * | fileName | ) | [virtual] |
Open file for reading.
| [in] | fileName | file 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.
| [out] | buf | Destination buffer |
| [in] | numBytes | Number 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.
| [out] | buf | Destination buffer |
| [in] | numFrames | Number 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.
| [out] | buf | Destination buffer |
| [in] | numFrames | Number 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.
| [in] | frameOffset | Sample frame offset |
| [in] | origin | seek origin (same as fseek) |
Seek to sample frame offset within the data chunk of file. Returns true if success, false if error.
Implements AFileIn.
1.7.5.1