arduino-audio-tools
|
Wraps the encoded data into Config, Data, and Meta segments so that we can recover the audio configuration and orignial segments if this is relevant. We assume that a full segment is written with each call of write(); The segments are separated with a new line character. More...
#include <ContainerBinary.h>
Public Member Functions | |
BinaryContainerEncoder (AudioEncoder &encoder) | |
BinaryContainerEncoder (AudioEncoder *encoder) | |
AudioInfo | audioInfo () |
void | begin () override |
void | begin (AudioInfo info) |
void | end () |
virtual const char * | mime () |
Provides the mime type of the encoded result. | |
operator bool () | |
void | setAudioInfo (AudioInfo info) override |
Defines the sample rate, number of channels and bits per sample. | |
void | setOutput (Print &outStream) |
size_t | write (const void *data, size_t len) |
Add data segment. On first write we also add a AudioInfo header. | |
size_t | writeMeta (const uint8_t *data, size_t len) |
Adds meta data segment. | |
Protected Member Functions | |
size_t | output (const uint8_t *data, size_t len) |
void | setupIntialOutputStream (Print &outStream) |
void | writeAudio (const uint8_t *data, size_t len) |
void | writeBlocking (Print *out, uint8_t *data, size_t len) |
void | writeHeader () |
Protected Attributes | |
SimpleContainerConfig | cfg |
SimpleContainerDataHeader | dh |
bool | is_beginning = true |
bool | is_initial_output = true |
SimpleContainerMetaDataHeader | meta |
AudioEncoder * | p_codec = nullptr |
Print * | p_final_print = nullptr |
AudioWriter * | p_print1 = nullptr |
AudioWriter * | p_print2 = nullptr |
uint64_t | packet_count = 0 |
int | repeat_header |
ContainerTargetPrint | target |
Wraps the encoded data into Config, Data, and Meta segments so that we can recover the audio configuration and orignial segments if this is relevant. We assume that a full segment is written with each call of write(); The segments are separated with a new line character.