Adafruit SoundBoard Library
Public Member Functions | List of all members
Adafruit_Soundboard Class Reference

Class that stores the state and functions of the soundboard object. More...

#include <Adafruit_Soundboard.h>

Inheritance diagram for Adafruit_Soundboard:

Public Member Functions

 Adafruit_Soundboard (Stream *s, Stream *d, int8_t r)
 Adafruit_Soundboard constructor. More...
 
boolean reset (void)
 Do a hard reset by bringing the RST pin low then read out the output lines. More...
 
int readLine (void)
 Reads a line from the stream. More...
 
uint8_t listFiles (void)
 Query the board for the # of files and names/sizes. More...
 
char * fileName (uint8_t n)
 Returns the filename. More...
 
uint32_t fileSize (uint8_t n)
 Returns the size of the file. More...
 
uint8_t volUp (void)
 Raises the volume. More...
 
uint8_t volDown (void)
 Lowers the volume. More...
 
boolean playTrack (uint8_t n)
 Play the specified track. More...
 
boolean playTrack (char *name)
 Play the specified track. More...
 
boolean pause (void)
 Pauses track. More...
 
boolean unpause (void)
 Unpauses track. More...
 
boolean stop (void)
 Stops track. More...
 
boolean trackTime (uint32_t *current, uint32_t *total)
 Returns the track time. More...
 
boolean trackSize (uint32_t *current, uint32_t *total)
 Returns the track size. More...
 

Detailed Description

Class that stores the state and functions of the soundboard object.

Constructor & Destructor Documentation

◆ Adafruit_Soundboard()

Adafruit_Soundboard::Adafruit_Soundboard ( Stream *  s,
Stream *  d,
int8_t  r 
)

Adafruit_Soundboard constructor.

Parameters
sPointer to the Serial stream
dPointer to the debug port
rReset pin

Member Function Documentation

◆ reset()

boolean Adafruit_Soundboard::reset ( void  )

Do a hard reset by bringing the RST pin low then read out the output lines.

Returns
Returns the output lines

◆ readLine()

int Adafruit_Soundboard::readLine ( void  )

Reads a line from the stream.

Returns
Returns the line read

◆ listFiles()

uint8_t Adafruit_Soundboard::listFiles ( void  )

Query the board for the # of files and names/sizes.

Returns
Returns the information about the files

◆ fileName()

char * Adafruit_Soundboard::fileName ( uint8_t  n)

Returns the filename.

Parameters
nId of the file
Returns
Returns the filename

◆ fileSize()

uint32_t Adafruit_Soundboard::fileSize ( uint8_t  n)

Returns the size of the file.

Parameters
nid of the file
Returns
Returns the filesize

◆ volUp()

uint8_t Adafruit_Soundboard::volUp ( void  )

Raises the volume.

Returns
Returns the current volume

◆ volDown()

uint8_t Adafruit_Soundboard::volDown ( void  )

Lowers the volume.

Returns
Returns the current volume

◆ playTrack() [1/2]

boolean Adafruit_Soundboard::playTrack ( uint8_t  n)

Play the specified track.

Parameters
ntrack id
Returns
Returns true if the track was played

◆ playTrack() [2/2]

boolean Adafruit_Soundboard::playTrack ( char *  name)

Play the specified track.

Parameters
nametrack name
Returns
Returns true if the track was played

◆ pause()

boolean Adafruit_Soundboard::pause ( void  )

Pauses track.

Returns
Returns if pausing was successful

◆ unpause()

boolean Adafruit_Soundboard::unpause ( void  )

Unpauses track.

Returns
Returns if unpausing was successful

◆ stop()

boolean Adafruit_Soundboard::stop ( void  )

Stops track.

Returns
Returns if stopping was successful

◆ trackTime()

boolean Adafruit_Soundboard::trackTime ( uint32_t *  current,
uint32_t *  total 
)

Returns the track time.

Parameters
currentBuffer with the current track time
totalBuffer with the total track time
Returns
Returns the current track time

◆ trackSize()

boolean Adafruit_Soundboard::trackSize ( uint32_t *  current,
uint32_t *  total 
)

Returns the track size.

Parameters
currentBuffer with the current track size
totalBuffer with the total track size
Returns
Returns how many bytes are remaining over the total track size

The documentation for this class was generated from the following files: