Arduino LibHelix
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MP3DecoderHelix Class Reference

A simple Arduino API for the libhelix MP3 decoder. The data is provided with the help of write() calls. The decoded result is available either via a callback method or via an output stream. More...

#include <MP3DecoderHelix.h>

Inheritance diagram for MP3DecoderHelix:
CommonHelix

Public Member Functions

 MP3DecoderHelix (Print &output, MP3Type mp3Type=MP3Normal, MP3InfoCallback infoCallback=nullptr)
 
 MP3DecoderHelix (MP3DataCallback dataCallback, MP3Type mp3Type=MP3Normal)
 
void begin ()
 Starts the processing.
 
void end ()
 Releases the reserved memory.
 
MP3FrameInfo audioInfo ()
 Provides the last available MP3FrameInfo.
 
- Public Member Functions inherited from CommonHelix
virtual size_t write (const void *in_ptr, size_t in_size)
 decodes the next segments from the intput. The data can be provided in one short or in small incremental pieces. It is suggested to be called in the Arduino Loop. If the provided data does not fit into the buffer it is split up into small pieces that fit
 
 operator bool ()
 returns true if active
 

Protected Member Functions

size_t maxFrameSize ()
 determines the frame buffer size that will be allocated
 
size_t maxPCMSize ()
 Determines the pcm buffer size that will be allocated.
 
int findSynchWord (int offset=0)
 Finds the synch word in the available buffer data starting from the indicated offset.
 
void decode (Range r)
 decods the data
 
void provideResult (MP3FrameInfo &info)
 
virtual void checkMemory ()
 checks the consistency of the memory
 
- Protected Member Functions inherited from CommonHelix
void setMaxFrameSize (size_t len)
 Define your optimized maximum frame size.
 
void setMaxPWMSize (size_t len)
 Define your optimized maximum pcm buffer size.
 
size_t appendToBuffer (const void *in_ptr, int in_size)
 we add the data to the buffer until it is full
 
size_t writeFrame (const void *in_ptr, size_t in_size)
 appends the data to the frame buffer and decodes
 
Range synchronizeFrame ()
 returns true if we have a valid start and end synch word.
 
Range frameRange ()
 determines the next start and end synch word in the buffer
 
void advanceFrameBuffer (int offset)
 

Protected Attributes

HMP3Decoder decoder = nullptr
 
MP3DataCallback pcmCallback = nullptr
 
MP3InfoCallback infoCallback = nullptr
 
MP3Type mp3_type
 
MP3FrameInfo mp3FrameInfo
 
- Protected Attributes inherited from CommonHelix
bool active = false
 
Print * out = nullptr
 
Stream * in = nullptr
 
uint32_t buffer_size = 0
 
uint8_t * frame_buffer = nullptr
 
short * pcm_buffer = nullptr
 
size_t max_frame_size = 0
 
size_t max_pcm_size = 0
 
size_t frame_counter = 0
 

Detailed Description

A simple Arduino API for the libhelix MP3 decoder. The data is provided with the help of write() calls. The decoded result is available either via a callback method or via an output stream.


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