arduino-audio-tools
All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BinaryContainerEncoder Class Reference

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>

Inheritance diagram for BinaryContainerEncoder:
AudioEncoder AudioWriter AudioInfoSupport

Public Member Functions

 BinaryContainerEncoder (AudioEncoder &encoder)
 
 BinaryContainerEncoder (AudioEncoder *encoder)
 
AudioInfo audioInfo () override
 provides the actual input AudioInfo
 
virtual AudioInfo audioInfoOut ()
 
bool begin () override
 
virtual bool 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 setEncoder (AudioEncoder *encoder)
 
void setOutput (Print &outStream)
 
size_t write (const uint8_t *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 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
 
AudioInfo info
 
bool is_beginning = true
 
SimpleContainerMetaDataHeader meta
 
AudioEncoderp_codec = nullptr
 
Printp_out = nullptr
 
uint64_t packet_count = 0
 
int repeat_header
 

Detailed Description

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.

Author
Phil Schatzmann

Member Function Documentation

◆ audioInfo()

AudioInfo audioInfo ( )
inlineoverridevirtual

provides the actual input AudioInfo

Reimplemented from AudioEncoder.

◆ audioInfoOut()

virtual AudioInfo audioInfoOut ( )
inlinevirtualinherited

◆ begin() [1/2]

bool begin ( )
inlineoverridevirtual

Implements AudioWriter.

◆ begin() [2/2]

virtual bool begin ( AudioInfo  info)
inlinevirtualinherited

Reimplemented in AACEncoderFDK.

◆ end()

void end ( )
inlinevirtual

Implements AudioWriter.

◆ mime()

virtual const char * mime ( )
inlinevirtual

Provides the mime type of the encoded result.

Implements AudioEncoder.

◆ operator bool()

operator bool ( )
inlinevirtual

Implements AudioWriter.

◆ setAudioInfo()

void setAudioInfo ( AudioInfo  from)
inlineoverridevirtual

Defines the sample rate, number of channels and bits per sample.

Reimplemented from AudioEncoder.

◆ setOutput()

void setOutput ( Print outStream)
inlinevirtual

Implements AudioWriter.

◆ write()

size_t write ( const uint8_t *  data,
size_t  len 
)
inlinevirtual

Add data segment. On first write we also add a AudioInfo header.

Implements AudioWriter.


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