54 FileRead( std::string fileName,
bool typeRaw =
false,
unsigned int nChannels = 1,
67 void open( std::string fileName,
bool typeRaw =
false,
unsigned int nChannels = 1,
77 unsigned long fileSize(
void )
const {
return fileSize_; };
80 unsigned int channels(
void )
const {
return channels_; };
83 StkFormat
format(
void )
const {
return dataType_; };
91 StkFloat
fileRate(
void )
const {
return fileRate_; };
106 void read(
StkFrames& buffer,
unsigned long startFrame = 0,
bool doNormalize =
true );
111 bool getRawInfo(
const char *fileName,
unsigned int nChannels,
112 StkFormat
format, StkFloat rate );
115 bool getWavInfo(
const char *fileName );
118 bool getSndInfo(
const char *fileName );
121 bool getAifInfo(
const char *fileName );
124 bool getMatInfo(
const char *fileName );
127 bool findNextMatArray( SINT32 *chunkSize, SINT32 *rows, SINT32 *columns, SINT32 *nametype );
132 unsigned long fileSize_;
133 unsigned long dataOffset_;
134 unsigned int channels_;
void open(std::string fileName, bool typeRaw=false, unsigned int nChannels=1, StkFormat format=STK_SINT16, StkFloat rate=22050.0)
Open the specified file and determine its formatting.
Definition: FileRead.cpp:78
StkFormat format(void) const
Return the data format of the file.
Definition: FileRead.h:83
unsigned long fileSize(void) const
Return the file size in sample frames.
Definition: FileRead.h:77
The STK namespace.
Definition: FileRead.cpp:41
STK audio file input class.
Definition: FileRead.h:41
void close(void)
If a file is open, close it.
Definition: FileRead.cpp:61
void read(StkFrames &buffer, unsigned long startFrame=0, bool doNormalize=true)
Read sample frames from the file into an StkFrames object.
Definition: FileRead.cpp:732
unsigned int channels(void) const
Return the number of audio channels in the file.
Definition: FileRead.h:80
bool isOpen(void)
Returns true if a file is currently open.
Definition: FileRead.cpp:72
An STK class to handle vectorized audio data.
Definition: Stk.h:272
~FileRead(void)
Class destructor.
Definition: FileRead.cpp:55
STK base class.
Definition: Stk.h:132
FileRead(void)
Default constructor.
Definition: FileRead.cpp:43
static const StkFormat STK_SINT16
Definition: Stk.h:138
StkFloat fileRate(void) const
Return the file sample rate in Hz.
Definition: FileRead.h:91