|
int | setup (const std::string &path, size_t bufferSize) |
|
void | getSamples (std::vector< float > &buffer) |
|
void | getSamples (float *dst, size_t samplesCount) |
|
int | setLoop (bool loop) |
|
int | setLoop (size_t start, size_t end) |
|
size_t | getIdx () |
|
size_t | getLength () const |
|
size_t | getChannels () const |
|
int | getSampleRate () const |
|
|
enum | Mode { kRead,
kWrite
} |
|
enum | { kNumBufs = 2
} |
|
int | setup (const std::string &path, size_t bufferSize, Mode mode, size_t channels=0, unsigned int sampleRate=0) |
|
void | scheduleIo () |
|
std::vector< float > & | getRtBuffer () |
|
void | threadLoop () |
|
volatile size_t | ioBuffer |
|
size_t | ioBufferOld |
|
std::array< std::vector< float >
, kNumBufs > | internalBuffers |
|
std::thread | diskIo |
|
size_t | size |
|
volatile bool | stop |
|
bool | ramOnly |
|
size_t | rtIdx |
|
SNDFILE * | sndfile = NULL |
|
SF_INFO | sfinfo = { 0 } |
|
int AudioFileReader::setup |
( |
const std::string & |
path, |
|
|
size_t |
bufferSize |
|
) |
| |
Open a file and prepare to stream it from disk.
- Parameters
-
path | Path to the file |
bufferSize | the size of the internal buffer. If this is larger than the file itself, the whole file will be loaded in memory, otherwise the file will be read from disk from a separate thread. |
void AudioFileReader::getSamples |
( |
std::vector< float > & |
buffer | ) |
|
Write interleaved samples from the file to the destination.
- Parameters
-
buffer | the destination buffer. Its size() must be a multiple of getChannels(). |
void AudioFileReader::getSamples |
( |
float * |
dst, |
|
|
size_t |
samplesCount |
|
) |
| |
Write interleaved samples from the file to the destination.
- Parameters
-
dst | the destination buffer |
samplesCount | The number of samples to write. This has to be a multiple of getChannels(). |
The documentation for this class was generated from the following files:
- libraries/AudioFile/AudioFile.h
- libraries/AudioFile/AudioFile.cpp