Base class that is used to load and read from an audio source. More...
#include <Source.h>
Public Member Functions | |
virtual | ~Source () |
size_t | getSampleRate () const |
Returns the user facing samplerate (output). More... | |
virtual size_t | getNumChannels () const =0 |
Returns the number of channels. More... | |
virtual size_t | getSampleRateNative () const =0 |
Returns the true samplerate of the Source. More... | |
size_t | getMaxFramesPerRead () const |
Returns the maximum number of frames that can be read with one call to read(). More... | |
virtual void | setMaxFramesPerRead (size_t count) |
Sets the maximum number of frames that can be read in one chunk. More... | |
virtual size_t | read (Buffer *buffer)=0 |
Loads either as many frames as buffer can hold, or as many as there are left. More... | |
virtual std::string | getMetaData () const |
Returns the metadata, if any, as a string. More... | |
Protected Member Functions | |
Source (size_t sampleRate) | |
virtual size_t | performRead (Buffer *buffer, size_t bufferFrameOffset, size_t numFramesNeeded)=0 |
virtual bool | supportsConversion () |
Implementations should override and return true if they can provide samplerate conversion. If false (default), a Converter will be used if needed. More... | |
void | setSampleRate (size_t sampleRate) |
Allows implementations to set the output samplerate. More... | |
Protected Attributes | |
std::unique_ptr< dsp::Converter > | mConverter |
BufferDynamic | mConverterReadBuffer |
Base class that is used to load and read from an audio source.
|
virtual |
|
protected |
size_t cinder::audio::Source::getSampleRate | ( | ) | const |
Returns the user facing samplerate (output).
|
pure virtual |
Returns the number of channels.
Implemented in cinder::audio::cocoa::SourceFileCoreAudio, and cinder::audio::SourceFileOggVorbis.
|
pure virtual |
Returns the true samplerate of the Source.
Implemented in cinder::audio::cocoa::SourceFileCoreAudio, and cinder::audio::SourceFileOggVorbis.
size_t cinder::audio::Source::getMaxFramesPerRead | ( | ) | const |
Returns the maximum number of frames that can be read with one call to read().
|
virtual |
Sets the maximum number of frames that can be read in one chunk.
|
pure virtual |
Loads either as many frames as buffer can hold, or as many as there are left.
Implemented in cinder::audio::SourceFile.
|
virtual |
Returns the metadata, if any, as a string.
Reimplemented in cinder::audio::SourceFileOggVorbis.
|
protectedpure virtual |
Implement to perform read of frames into buffer starting at offset bufferFrameOffset
Implemented in cinder::audio::SourceFileOggVorbis.
|
protectedvirtual |
Implementations should override and return true if they can provide samplerate conversion. If false (default), a Converter will be used if needed.
|
protected |
Allows implementations to set the output samplerate.
|
protected |
|
protected |