arduino-audio-tools
|
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>
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 () |
WAVAudioInfo & | audioInfoEx () |
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) |
Print & | out () |
void | setupEncodedAudio () |
void | writeBlocking (Print *out, uint8_t *data, size_t len) |
Protected Attributes | |
bool | active = false |
AudioInfoSupport * | audioBaseInfoSupport =nullptr |
EncodedAudioOutput | dec_out |
AudioFormat | decoder_format = AudioFormat::PCM |
WAVHeader | header |
AudioInfo | info |
bool | isFirst = true |
bool | isValid = true |
AudioDecoderExt * | p_decoder = nullptr |
AudioInfoSupport * | p_notify = nullptr |
Print * | p_print = nullptr |
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.