arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
G7xxEncoder Class Reference

g723_24, g721, g723_40 Encoder based on https://github.com/pschatzmann/codec-g7xx More...

#include <CodecG7xx.h>

Inheritance diagram for G7xxEncoder:
AudioEncoder AudioWriter MimeSource AudioInfoSupport G711Encoder G721Encoder G723_24Encoder G723_40Encoder G711_ALAWEncoder G711_ULAWEncoder

Public Member Functions

 G7xxEncoder (G7xxCODEC_e codec)
 
AudioInfo audioInfo () override
 provides the actual input AudioInfo
 
virtual AudioInfo audioInfoOut ()
 
bool begin () override
 
virtual bool begin (AudioInfo info)
 
void end () override
 
virtual uint32_t frameDurationUs ()
 Optional rtsp function: provide the frame duration in microseconds.
 
virtual int frameSize ()
 
const char * mime () override
 Provides the mime type of the encoded result.
 
 operator bool ()
 
virtual uint16_t samplesPerFrame ()
 Optional rtsp function: provide samples per the frame.
 
virtual void setAudioInfo (AudioInfo info)
 Defines the sample rate, number of channels and bits per sample.
 
void setOutput (Print &out_stream) override
 Default output assignment (encoders may override to store Print reference)
 
size_t write (const uint8_t *data, size_t len) override
 

Protected Member Functions

void writeBlocking (Print *out, uint8_t *data, size_t len)
 

Protected Attributes

unsigned char code
 
int enc_bits
 
int(* enc_routine )(int sample, int in_coding, struct g72x_state *state_ptr)
 
AudioInfo info
 
bool is_active = false
 
int out_bits = 0
 
unsigned int out_buffer = 0
 
const char * p_mime = nullptr
 
Print * p_print = nullptr
 
int resid
 
unsigned char sample_char
 
int16_t sample_int16
 
struct g72x_state state
 

Detailed Description

g723_24, g721, g723_40 Encoder based on https://github.com/pschatzmann/codec-g7xx

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ G7xxEncoder()

G7xxEncoder ( G7xxCODEC_e  codec)
inline

Member Function Documentation

◆ audioInfo()

AudioInfo audioInfo ( )
inlineoverridevirtualinherited

provides the actual input AudioInfo

Implements AudioInfoSupport.

Reimplemented in CodecNOP, MP3EncoderShine, BinaryContainerEncoder, and MP3ParserEncoder.

◆ audioInfoOut()

virtual AudioInfo audioInfoOut ( )
inlinevirtualinherited

◆ begin() [1/2]

bool begin ( )
inlineoverridevirtual

Implements AudioWriter.

◆ begin() [2/2]

virtual bool begin ( AudioInfo  info)
inlinevirtualinherited

◆ end()

void end ( )
inlineoverridevirtual

Implements AudioWriter.

◆ frameDurationUs()

virtual uint32_t frameDurationUs ( )
inlinevirtualinherited

Optional rtsp function: provide the frame duration in microseconds.

Reimplemented in ADPCMEncoder, MP3EncoderShine, OpusOggEncoder, MP3ParserEncoder, and MetaDataFilterEncoder.

◆ frameSize()

virtual int frameSize ( )
inlinevirtualinherited

Optional rtsp function: provide the encoded size (in bytes) of one frame, once known (e.g. after the encoder has seen real data). Lets an RTSPFormat size its RTP fragments to match one frame instead of a fixed guess, so throughput actually tracks frameDurationUs() - a fragment size covering several frames' worth of bytes sent at one-frame timing overruns real-time bandwidth and, over UDP (no flow control), causes packet loss. Returns 0 if not yet known/not applicable (fixed-frame-size codecs have no need to override this).

Reimplemented in ADPCMEncoder, EncoderALAC, AMRNBEncoder, AMRWBEncoder, and MP3ParserEncoder.

◆ mime()

const char * mime ( )
inlineoverridevirtual

Provides the mime type of the encoded result.

Implements AudioEncoder.

◆ operator bool()

operator bool ( )
inlinevirtual

Implements AudioWriter.

◆ samplesPerFrame()

virtual uint16_t samplesPerFrame ( )
inlinevirtualinherited

Optional rtsp function: provide samples per the frame.

Reimplemented in OpusAudioEncoder, OpusMultiStreamAudioEncoder, MP3EncoderShine, MP3ParserEncoder, and MetaDataFilterEncoder.

◆ setAudioInfo()

virtual void setAudioInfo ( AudioInfo  from)
inlinevirtual

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

Reimplemented from AudioEncoder.

◆ setOutput()

void setOutput ( Print &  out_stream)
inlineoverridevirtual

Default output assignment (encoders may override to store Print reference)

Reimplemented from AudioEncoder.

◆ write()

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

Implements AudioWriter.

◆ writeBlocking()

void writeBlocking ( Print *  out,
uint8_t *  data,
size_t  len 
)
inlineprotectedinherited

Member Data Documentation

◆ code

unsigned char code
protected

◆ enc_bits

int enc_bits
protected

◆ enc_routine

int(* enc_routine) (int sample, int in_coding, struct g72x_state *state_ptr)
protected

◆ info

AudioInfo info
protectedinherited

◆ is_active

bool is_active = false
protected

◆ out_bits

int out_bits = 0
protected

◆ out_buffer

unsigned int out_buffer = 0
protected

◆ p_mime

const char* p_mime = nullptr
protected

◆ p_print

Print* p_print = nullptr
protected

◆ resid

int resid
protected

◆ sample_char

unsigned char sample_char
protected

◆ sample_int16

int16_t sample_int16
protected

◆ state

struct g72x_state state
protected

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