Wav Player that will load .wav files from an SD Card, and then provide a method of accessing the samples with double-buffering.
#include <wavplayer.h>
Public Member Functions | |
WavPlayer () | |
~WavPlayer () | |
void | Init (const char *search_path) |
int | Open (size_t sel) |
int | Close () |
int16_t | Stream () |
void | Prepare () |
void | Restart () |
void | SetLooping (bool loop) |
bool | GetLooping () const |
size_t | GetNumberFiles () const |
size_t | GetCurrentFile () const |
|
inline |
|
inline |
int daisy::WavPlayer::Close | ( | ) |
Closes whatever file is currently open.
|
inline |
|
inline |
Initializes the WavPlayer, loading up to max_files of wav files from an SD Card.
Opens the file at index sel for reading.
sel | File to open |
void daisy::WavPlayer::Prepare | ( | ) |
Collects buffer for playback when needed.
void daisy::WavPlayer::Restart | ( | ) |
Resets the playback position to the beginning of the file immediately
Sets whether or not the current file will repeat after completing playback.
loop | To loop or not to loop. |
int16_t daisy::WavPlayer::Stream | ( | ) |