#include <AudioFileReader.h>


Public Member Functions | |
| AudioFileReader (const FileName &f, const Config &c, BigEndian be=BIGENDIAN_AUTO) | |
| virtual | ~AudioFileReader () |
| virtual bool | readFrame (AudioFrame &f) |
| virtual void | seekFrame (unsigned long pos) |
| virtual void | reset () |
| virtual void | close () |
| unsigned long | getFrameCount () |
| virtual unsigned long | getChannelCount () |
| virtual unsigned long | getSampleBytes () |
| virtual real_t | getFrameRate () |
| virtual unsigned long | getSourceCount () |
| virtual String | getClassName () const |
| String | toString () const |
Static Public Member Functions | |
| static AudioFileReader & | create (const FileName &f, const Config &c, BigEndian be=BIGENDIAN_AUTO) |
Private Member Functions | |
| String | getPath (const FileName &, const Config &) const |
| String | getExt (const FileName &, const Config &) const |
| unsigned long | getChannel (const Config &) const |
| bool | getBigEndian (const Config &, BigEndian) const |
| void | readParams () |
| unsigned long | getHeaderLength () |
Private Attributes | |
| FileReader * | _pReader |
| unsigned long | _frameCount |
| unsigned long | _frameIndex |
| unsigned long | _headerLength |
| unsigned long | _channelCount |
| unsigned long | _sampleBytes |
| real_t | _frameRate |
| bool | _paramDefined |
| bool | _seekWanted |
| unsigned long | _seekWantedIdx |
Friends | |
| class | TestAudioFileReader |
Class used to read audio files.
Definition at line 83 of file AudioFileReader.h.
| R::AudioFileReader | ( | const FileName & | f, |
| const Config & | c, | ||
| BigEndian | be = BIGENDIAN_AUTO |
||
| ) | [explicit] |
Build the reader
| f | the file to read |
| c | the configuration to use |
| be | Big/little endian flag |
Definition at line 68 of file AudioFileReader.cpp.
| R::~AudioFileReader | ( | ) | [virtual] |
Definition at line 318 of file AudioFileReader.cpp.
References NULL.
| void R::close | ( | ) | [virtual] |
Closes the file
Implements alize::AudioInputStream.
Definition at line 99 of file AudioFileReader.cpp.
References NULL.
Definition at line 78 of file AudioFileReader.cpp.
Definition at line 112 of file AudioFileReader.cpp.
References alize::BIGENDIAN_FALSE, and alize::BIGENDIAN_TRUE.
| unsigned long R::getChannel | ( | const Config & | c ) | const [private] |
Definition at line 105 of file AudioFileReader.cpp.
References alize::Config::existsParam_loadAudioFileChannel, and alize::Config::getParam_loadAudioFileChannel().
| unsigned long R::getChannelCount | ( | ) | [virtual] |
Returns the channel count of the file
Implements alize::AudioInputStream.
Definition at line 285 of file AudioFileReader.cpp.
Referenced by toString().
| String R::getClassName | ( | ) | const [virtual] |
Returns the name of the class
Implements alize::Object.
Definition at line 306 of file AudioFileReader.cpp.
Definition at line 92 of file AudioFileReader.cpp.
References alize::String::beginsWith(), and alize::Config::getParam_loadAudioFileExtension().
| unsigned long R::getFrameCount | ( | ) | [virtual] |
Returns the frame count of the file
Implements alize::AudioInputStream.
Definition at line 210 of file AudioFileReader.cpp.
Referenced by toString().
| real_t R::getFrameRate | ( | ) | [virtual] |
Returns the frame rate (in frames per second)
Implements alize::AudioInputStream.
Definition at line 299 of file AudioFileReader.cpp.
| unsigned long R::getHeaderLength | ( | ) | [private] |
Definition at line 278 of file AudioFileReader.cpp.
Definition at line 85 of file AudioFileReader.cpp.
References alize::String::beginsWith(), and alize::Config::getParam_audioFilesPath().
| unsigned long R::getSampleBytes | ( | ) | [virtual] |
Returns the sample size in bytes of this file
Implements alize::AudioInputStream.
Definition at line 292 of file AudioFileReader.cpp.
Referenced by toString().
| unsigned long R::getSourceCount | ( | ) | [virtual] |
Returns the number of files read by the reader
Implements alize::AudioInputStream.
Definition at line 276 of file AudioFileReader.cpp.
| bool R::readFrame | ( | AudioFrame & | f ) | [virtual] |
Reads the next available audio frame
Reads a unique channel. See method setSelectedChannel(...) to choose a channel
| f | the audio frame object to store the data |
| IOException | if an I/O error occurs |
Implements alize::AudioInputStream.
Definition at line 126 of file AudioFileReader.cpp.
References alize::AudioFrame::setData(), alize::AudioFrame::setValidity(), and alize::String::valueOf().
| void R::readParams | ( | ) | [private] |
Definition at line 217 of file AudioFileReader.cpp.
References alize::String::beginsWith(), alize::String::getToken(), NULL, and alize::String::toLong().
| void R::reset | ( | ) | [virtual] |
Same effect as seekFrame(0)
Does not change selected channel
Implements alize::AudioInputStream.
Definition at line 274 of file AudioFileReader.cpp.
| void R::seekFrame | ( | unsigned long | n ) | [virtual] |
Sets the position indicator associated with the stream to a new position. Does not throw any exception or error if the position exceeds file length
| pos | position of the next frame to read |
Implements alize::AudioInputStream.
Definition at line 204 of file AudioFileReader.cpp.
| String R::toString | ( | ) | const [virtual] |
This method is frequently overridden in the derived classes. If it is not, it returns the name of the class of the object and the address of the object
Reimplemented from alize::Object.
Definition at line 308 of file AudioFileReader.cpp.
References getChannelCount(), getFrameCount(), getSampleBytes(), alize::AudioInputStream::getSelectedChannel(), alize::Object::toString(), and alize::String::valueOf().
friend class TestAudioFileReader [friend] |
Reimplemented from alize::AudioInputStream.
Definition at line 85 of file AudioFileReader.h.
unsigned long alize::AudioFileReader::_channelCount [private] |
Definition at line 152 of file AudioFileReader.h.
unsigned long alize::AudioFileReader::_frameCount [private] |
Definition at line 149 of file AudioFileReader.h.
unsigned long alize::AudioFileReader::_frameIndex [private] |
Definition at line 150 of file AudioFileReader.h.
real_t alize::AudioFileReader::_frameRate [private] |
Definition at line 154 of file AudioFileReader.h.
unsigned long alize::AudioFileReader::_headerLength [private] |
Definition at line 151 of file AudioFileReader.h.
bool alize::AudioFileReader::_paramDefined [private] |
Definition at line 155 of file AudioFileReader.h.
FileReader* alize::AudioFileReader::_pReader [private] |
Definition at line 148 of file AudioFileReader.h.
unsigned long alize::AudioFileReader::_sampleBytes [private] |
Definition at line 153 of file AudioFileReader.h.
bool alize::AudioFileReader::_seekWanted [private] |
Definition at line 156 of file AudioFileReader.h.
unsigned long alize::AudioFileReader::_seekWantedIdx [private] |
Definition at line 157 of file AudioFileReader.h.
1.7.2