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 () |
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 () |
Provides the default configuration. | |
void | end () override |
stops the processing | |
virtual uint32_t | frameDurationUs () |
Optional rtsp function: provide the frame duration in microseconds. | |
bool | isOpen () |
Check if encoder is open. | |
const char * | mime () override |
Provides "audio/wav". | |
operator bool () override | |
Check if encoder is active and ready to write. | |
virtual uint16_t | samplesPerFrame () |
Optional rtsp function: provide samples per the frame. | |
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) |
Associates an external encoder for non-PCM formats. | |
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.
|
inlinevirtualinherited |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in PureDataStream, PWMAudioOutput, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, and ResampleStreamT< TInterpolator >.
|
inlineoverridevirtual |
starts the processing using the actual WAVAudioInfo
Implements AudioWriter.
|
inlinevirtualinherited |
Reimplemented in AACEncoderFDK.
|
inlineoverridevirtual |
stops the processing
Implements AudioWriter.
|
inlinevirtualinherited |
Optional rtsp function: provide the frame duration in microseconds.
Reimplemented in ADPCMEncoder, OpusOggEncoder, MP3ParserEncoder, and MetaDataFilterEncoder.
|
inlineoverridevirtual |
Provides "audio/wav".
Implements AudioEncoder.
|
inlineoverridevirtual |
Check if encoder is active and ready to write.
Implements AudioWriter.
|
inlinevirtualinherited |
Optional rtsp function: provide samples per the frame.
Reimplemented in MP3ParserEncoder, and MetaDataFilterEncoder.
|
inlineoverridevirtual |
Update actual WAVAudioInfo.
Reimplemented from AudioEncoder.
|
inlineoverridevirtual |
Defines the otuput stream.
Reimplemented from AudioEncoder.
|
inlineoverridevirtual |
Writes PCM data to be encoded as WAV.
Implements AudioWriter.