EMIPLIB
1.2.1
|
A sound file input component. More...
#include <mipwavinput.h>
Public Member Functions | |
bool | open (const std::string &fname, int frames, bool loop=true, bool intSamples=false) |
Opens a sound file. More... | |
bool | open (const std::string &fname, MIPTime interval, bool loop=true, bool intSamples=false) |
Opens a sound file. More... | |
bool | close () |
Closes the sound file. More... | |
int | getSamplingRate () const |
Returns the sampling rate of the sound file. More... | |
int | getNumberOfFrames () const |
Returns the number of frames that will be read during each iteration. More... | |
int | getNumberOfChannels () const |
Returns the number of channels in the sound file. More... | |
void | setSourceID (uint64_t sourceID) |
Sets the source ID for outgoing messages. More... | |
Public Member Functions inherited from MIPComponent | |
virtual void | lock () |
Locks the current component. More... | |
virtual void | unlock () |
Unlocks the current component. More... | |
virtual bool | processFeedback (const MIPComponentChain &chain, int64_t feedbackChainID, MIPFeedback *feedback) |
Add feedback information about this component. More... | |
std::string | getComponentName () const |
Returns the name of the component. More... | |
Public Member Functions inherited from MIPErrorBase | |
std::string | getErrorString () const |
Returns the last known error description. More... | |
Protected Member Functions | |
virtual void | onLastInputFrame () |
This function is called when the last frame of the input file has been read. More... | |
Protected Member Functions inherited from MIPComponent | |
MIPComponent (const std::string &componentName) | |
Create a component with the specified name. More... | |
Protected Member Functions inherited from MIPErrorBase | |
void | setErrorString (const std::string &str) const |
Stores an error description. More... | |
This component can be used to read audio from a WAV file. The component accepts MIPSYSTEMMESSAGE_ISTIME messages, so a timing component should send its messages to the component. The output messages contain raw audio in floating point or 16 bit signed native encoding.
bool MIPWAVInput::close | ( | ) |
Use this function to stop using a previously opened sound file.
|
inline |
|
inline |
|
inline |
|
inlineprotectedvirtual |
This function is called when the last frame of the input file has been read. In this function you could send a signal to another thread, indicating that the chain can be stopped for example.
bool MIPWAVInput::open | ( | const std::string & | fname, |
int | frames, | ||
bool | loop = true , |
||
bool | intSamples = false |
||
) |
With this function, a sound file can be opened for reading.
fname | The name of the sound file |
frames | The number of frames which should be read during each iteration. |
loop | Flag indicating if the sound file should be played over and over again or just once. |
intSamples | If true , 16 bit integer samples will be used. If false , floating point samples will be used. |
bool MIPWAVInput::open | ( | const std::string & | fname, |
MIPTime | interval, | ||
bool | loop = true , |
||
bool | intSamples = false |
||
) |
With this function, a sound file can be opened for reading.
fname | The name of the sound file |
interval | During each iteration, a number of frames corresponding to the time interval described by this parameter are read. |
loop | Flag indicating if the sound file should be played over and over again or just once. |
intSamples | If true , 16 bit integer samples will be used. If false , floating point samples will be used. |
|
inline |
References MIPComponent::pull(), and MIPComponent::push().