arduino-audio-tools
|
A simple WAV file encoder. If no AudioEncoderExt is specified the WAV file contains PCM data, otherwise it is encoded as ADPCM. The WAV header is written with the first writing of audio data. Calling begin() is making sure that the header is written again. More...
#include <CodecWAV.h>
Public Member Functions | |
WAVEncoder ()=default | |
Construct a new WAVEncoder object for PCM data. | |
WAVEncoder (AudioEncoderExt &enc, AudioFormat fmt) | |
Construct a new WAVEncoder object for ADPCM data. | |
virtual AudioInfo | audioInfoOut () |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream | |
virtual bool | begin () override |
starts the processing using the actual WAVAudioInfo | |
virtual bool | begin (AudioInfo info) |
bool | begin (WAVAudioInfo ai) |
starts the processing | |
WAVAudioInfo | defaultConfig () |
void | end () override |
stops the processing | |
bool | isOpen () |
const char * | mime () override |
Provides "audio/wav". | |
operator bool () override | |
virtual void | setAudioInfo (AudioInfo from) override |
Update actual WAVAudioInfo. | |
virtual void | setAudioInfo (WAVAudioInfo ai) |
Defines the WAVAudioInfo. | |
void | setDataOffset (uint16_t offset) |
Adds n empty bytes at the beginning of the data. | |
void | setEncoder (AudioEncoderExt &enc, AudioFormat fmt) |
void | setOutput (Print &out) override |
Defines the otuput stream. | |
virtual size_t | write (const uint8_t *data, size_t len) override |
Writes PCM data to be encoded as WAV. | |
Protected Member Functions | |
void | setupEncodedAudio () |
void | writeBlocking (Print *out, uint8_t *data, size_t len) |
Protected Attributes | |
WAVAudioInfo | audioInfo = defaultConfig() |
EncodedAudioOutput | enc_out |
WAVHeader | header |
bool | header_written = false |
AudioInfo | info |
volatile bool | is_open = false |
AudioEncoderExt * | p_encoder = nullptr |
Print * | p_print = nullptr |
int64_t | size_limit = 0 |
A simple WAV file encoder. If no AudioEncoderExt is specified the WAV file contains PCM data, otherwise it is encoded as ADPCM. The WAV header is written with the first writing of audio data. Calling begin() is making sure that the header is written again.