46 FileWvIn(
unsigned long chunkThreshold = 1000000,
unsigned long chunkSize = 1024 );
53 FileWvIn( std::string fileName,
bool raw =
false,
bool doNormalize =
true,
54 unsigned long chunkThreshold = 1000000,
unsigned long chunkSize = 1024 );
69 virtual void openFile( std::string fileName,
bool raw =
false,
bool doNormalize =
true );
75 virtual void reset(
void );
112 virtual void setRate( StkFloat rate );
118 virtual void addTime( StkFloat time );
139 StkFloat
lastOut(
unsigned int channel = 0 );
151 virtual StkFloat
tick(
unsigned int channel = 0 );
166 void sampleRateChanged( StkFloat newRate, StkFloat oldRate );
175 unsigned long chunkThreshold_;
176 unsigned long chunkSize_;
183 #if defined(_STK_DEBUG_) 184 if ( channel >= data_.
channels() ) {
185 oStream_ <<
"FileWvIn::lastOut(): channel argument and soundfile data are incompatible!";
190 if ( finished_ )
return 0.0;
191 return lastFrame_[channel];
bool isFinished(void) const
Query whether reading is complete.
Definition: FileWvIn.h:106
static void handleError(const char *message, StkError::Type type)
Static function for error reporting and handling using c-strings.
virtual void openFile(std::string fileName, bool raw=false, bool doNormalize=true)
Open the specified file and load its data.
StkFloat lastOut(unsigned int channel=0)
Return the specified channel value of the last computed frame.
Definition: FileWvIn.h:181
STK audio file input class.
Definition: FileRead.h:41
STK audio file input class.
Definition: FileWvIn.h:42
FileWvIn(unsigned long chunkThreshold=1000000, unsigned long chunkSize=1024)
Default constructor.
unsigned int channels(void) const
Return the number of channels represented by the data.
Definition: Stk.h:377
The STK namespace.
Definition: ADSR.h:6
bool isOpen(void)
Query whether a file is open.
Definition: FileWvIn.h:103
virtual void closeFile(void)
Close a file if one is open.
virtual void addTime(StkFloat time)
Increment the read pointer by time samples.
STK audio input abstract base class.
Definition: WvIn.h:19
unsigned long fileSize(void) const
Return the file size in sample frames.
Definition: FileRead.h:77
virtual void setRate(StkFloat rate)
Set the data read rate in samples. The rate can be negative.
virtual void reset(void)
Clear outputs and reset time (file) pointer to zero.
bool isOpen(void)
Returns true if a file is currently open.
An STK class to handle vectorized audio data.
Definition: Stk.h:272
virtual StkFloat tick(unsigned int channel=0)
Compute a sample frame and return the specified channel value.
virtual void normalize(void)
Normalize data to a maximum of +-1.0.
void setInterpolate(bool doInterpolate)
Turn linear interpolation on/off.
Definition: FileWvIn.h:127
virtual unsigned long getSize(void) const
Return the file size in sample frames.
Definition: FileWvIn.h:92
virtual StkFloat getFileRate(void) const
Return the input file sample rate in Hz (not the data read rate).
Definition: FileWvIn.h:100
StkFloat dataRate(void) const
Return the sample rate associated with the StkFrames data.
Definition: Stk.h:394
~FileWvIn(void)
Class destructor.