1 #ifndef LIB_ADAFRUIT_MP3_H 2 #define LIB_ADAFRUIT_MP3_H 9 #define OUTBUF_SIZE (16 * 1024) 10 #define INBUF_SIZE (16 * 1024) 12 #define BUFFER_LOWER_THRESH (8 * 1024) 15 #define MP3_IRQn TC2_IRQn 16 #define MP3_Handler TC2_Handler 17 #define MP3_GCLK_ID TC2_GCLK_ID 21 int16_t buffer[OUTBUF_SIZE];
26 Adafruit_mp3() : hMP3Decoder() { inbufend = (inBuf + INBUF_SIZE); }
40 HMP3Decoder hMP3Decoder;
42 volatile int bytesLeft;
45 uint8_t inBuf[INBUF_SIZE];
49 int (*bufferCallback)(uint8_t *, int);
void resume()
Resume playback. This function re-enables the playback timer. If you are starting playback of a new f...
Definition: Adafruit_mp3.cpp:165
void stop()
Stop playback. This function stops the playback timer.
Definition: Adafruit_mp3.cpp:153
Definition: Adafruit_mp3.h:19
Definition: Adafruit_mp3.h:24
int tick()
The main loop of the mp3 player. This function should be called as fast as possible in the loop() fun...
Definition: Adafruit_mp3.cpp:179
void setSampleReadyCallback(void(*fun_ptr)(int16_t, int16_t))
Set the function that the player will call when the playback timer fires. The callback is called insi...
Definition: Adafruit_mp3.cpp:121
void play()
Play an mp3 file. This function resets the buffers and should only be used when beginning playback of...
Definition: Adafruit_mp3.cpp:131
bool begin()
Begin the mp3 player. This initializes the playback timer and necessary interrupts.
Definition: Adafruit_mp3.cpp:61
void setBufferCallback(int(*fun_ptr)(uint8_t *, int))
Set the function the player will call when it's buffers need to be filled. Care must be taken to ensu...
Definition: Adafruit_mp3.cpp:106