arduino-audio-tools
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
WAVDecoder Class Reference

A simple WAVDecoder: We parse the header data on the first record to determine the format. If no AudioDecoderExt is specified we just write the PCM data to the output that is defined by calling setOutput(). You can define a ADPCM decoder to decode WAV files that contain ADPCM data. More...

#include <CodecWAV.h>

Inheritance diagram for WAVDecoder:
AudioDecoder AudioWriter AudioInfoSource

Public Member Functions

 WAVDecoder ()=default
 Construct a new WAVDecoder object for PCM data.
 
 WAVDecoder (AudioDecoderExt &dec, AudioFormat fmt)
 Construct a new WAVDecoder object for ADPCM data.
 
AudioInfo audioInfo ()
 
WAVAudioInfoaudioInfoEx ()
 
void begin ()
 
virtual void begin (AudioInfo info)
 
void end ()
 
virtual bool isResultPCM ()
 If true, the decoding result is PCM data.
 
const char * mime ()
 
virtual operator bool ()
 
virtual void setAudioInfo (AudioInfo from) override
 for most decoders this is not needed
 
void setDecoder (AudioDecoderExt &dec, AudioFormat fmt)
 Defines an optional decoder if the format is not PCM.
 
void setNotifyAudioChange (AudioInfoSupport &bi)
 Defines the object that needs to be notified about audio format changes.
 
virtual void setOutput (AudioOutput &out_stream)
 Defines where the decoded result is written to.
 
virtual void setOutput (AudioStream &out_stream)
 Defines where the decoded result is written to.
 
void setOutput (Print &out_stream)
 Defines the output Stream.
 
virtual size_t write (const void *in_ptr, size_t in_size)
 

Protected Member Functions

int decodeHeader (uint8_t *in_ptr, size_t in_size)
 
Printout ()
 
void setupEncodedAudio ()
 
void writeBlocking (Print *out, uint8_t *data, size_t len)
 

Protected Attributes

bool active = false
 
AudioInfoSupportaudioBaseInfoSupport =nullptr
 
EncodedAudioOutput dec_out
 
AudioFormat decoder_format = AudioFormat::PCM
 
WAVHeader header
 
AudioInfo info
 
bool isFirst = true
 
bool isValid = true
 
AudioDecoderExtp_decoder = nullptr
 
AudioInfoSupportp_notify = nullptr
 
Printp_print = nullptr
 

Detailed Description

A simple WAVDecoder: We parse the header data on the first record to determine the format. If no AudioDecoderExt is specified we just write the PCM data to the output that is defined by calling setOutput(). You can define a ADPCM decoder to decode WAV files that contain ADPCM data.

Author
Phil Schatzmann

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