Skip to content

Class daisy::WavPlayer

ClassList > daisy > WavPlayer

More...

  • #include <wavplayer.h>

Public Functions

Type Name
int Close ()
size_t GetCurrentFile () const
bool GetLooping () const
size_t GetNumberFiles () const
void Init (const char * search_path)
int Open (size_t sel)
void Prepare ()
void Restart ()
void SetLooping (bool loop)
int16_t Stream ()
WavPlayer ()
~WavPlayer ()

Detailed Description

Wav Player that will load .wav files from an SD Card, and then provide a method of accessing the samples with double-buffering.

Public Functions Documentation

function Close

int daisy::WavPlayer::Close () 

Closes whatever file is currently open.

Returns:

&


function GetCurrentFile

inline size_t daisy::WavPlayer::GetCurrentFile () const

Returns:

currently selected file.


function GetLooping

inline bool daisy::WavPlayer::GetLooping () const

Returns:

Whether the WavPlayer is looping or not.


function GetNumberFiles

inline size_t daisy::WavPlayer::GetNumberFiles () const

Returns:

The number of files loaded by the WavPlayer


function Init

void daisy::WavPlayer::Init (
    const  char * search_path
) 

Initializes the WavPlayer, loading up to max_files of wav files from an SD Card.


function Open

int daisy::WavPlayer::Open (
    size_t sel
) 

Opens the file at index sel for reading.

Parameters:

  • sel File to open

function Prepare

void daisy::WavPlayer::Prepare () 

Collects buffer for playback when needed.


function Restart

void daisy::WavPlayer::Restart () 

Resets the playback position to the beginning of the file immediately


function SetLooping

inline void daisy::WavPlayer::SetLooping (
    bool loop
) 

Sets whether or not the current file will repeat after completing playback.

Parameters:

  • loop To loop or not to loop.

function Stream

int16_t daisy::WavPlayer::Stream () 

Returns:

The next sample if playing, otherwise returns 0


function WavPlayer

inline daisy::WavPlayer::WavPlayer () 

function ~WavPlayer

inline daisy::WavPlayer::~WavPlayer () 


The documentation for this class was generated from the following file external-docs/libDaisy/src/hid/wavplayer.h