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

G.729 decoder using the bcg729 library. More...

#include <CodecG729.h>

Inheritance diagram for G729Decoder:
AudioDecoder AudioWriter AudioInfoSource AudioInfoSupport

Public Member Functions

 G729Decoder ()
 
virtual void addNotifyAudioChange (AudioInfoSupport &bi)
 Adds target to be notified about audio changes.
 
AudioInfo audioInfo () override
 provides the actual input AudioInfo
 
virtual AudioInfo audioInfoOut ()
 
bool begin () override
 
virtual bool begin (AudioInfo info) override
 
virtual void clearNotifyAudioChange ()
 Deletes all change notify subscriptions.
 
void end () override
 
PrintgetOutput ()
 
bool isNotifyActive ()
 Checks if the automatic AudioInfo update is active.
 
virtual bool isResultPCM ()
 Returns true to indicate that the decoding result is PCM data.
 
 operator bool () override
 
virtual bool removeNotifyAudioChange (AudioInfoSupport &bi)
 Removes a target in order not to be notified about audio changes.
 
void setAudioInfo (AudioInfo info) override
 for most decoders this is not needed
 
virtual bool setCodecConfig (const uint8_t *data, size_t len)
 Some decoders need e.g. a magic cookie to provide the relevant info for decoding.
 
void setNotifyActive (bool flag)
 Deactivate/Reactivate automatic AudioInfo updates: (default is active)
 
virtual void setOutput (AudioOutput &out_stream)
 Defines where the decoded result is written to.
 
virtual void setOutput (AudioStream &out_stream)
 Defines where the decoded result is written to.
 
void setOutput (Print &out_stream) override
 Defines where the decoded result is written to.
 
size_t write (const uint8_t *data, size_t len) override
 

Public Attributes

int id
 custom id to be used by application
 

Protected Member Functions

void decodeFrame (const uint8_t *data, size_t frame_len)
 
void notifyAudioChange (AudioInfo info)
 
void processByte (uint8_t byte)
 
void writeBlocking (Print *out, uint8_t *data, size_t len)
 

Protected Attributes

bcg729DecoderChannelContextStructdecoder_ctx = nullptr
 
AudioInfo info
 
Vector< uint8_tinput_buffer
 
size_t input_pos = 0
 
bool is_active = false
 
bool is_notify_active = true
 
Vector< AudioInfoSupport * > notify_vector
 
Printp_print = nullptr
 
Vector< uint8_tresult_buffer
 

Detailed Description

G.729 decoder using the bcg729 library.

Accepts a raw G.729 byte stream and writes 16-bit PCM samples to the configured output. Both 10-byte speech frames and 2-byte SID (comfort-noise) frames are supported:

Output is always fixed at 8 000 Hz / mono / 16-bit PCM. Passing any other AudioInfo via setAudioInfo() triggers a warning but the fixed format is still used.

Note
Requires https://github.com/pschatzmann/codec-bcg729
Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ G729Decoder()

G729Decoder ( )
inline

Member Function Documentation

◆ addNotifyAudioChange()

virtual void addNotifyAudioChange ( AudioInfoSupport bi)
inlinevirtualinherited

◆ audioInfo()

AudioInfo audioInfo ( )
inlineoverridevirtualinherited

◆ audioInfoOut()

virtual AudioInfo audioInfoOut ( )
inlinevirtualinherited

◆ begin() [1/2]

bool begin ( )
inlineoverridevirtual

Reimplemented from AudioDecoder.

◆ begin() [2/2]

virtual bool begin ( AudioInfo  info)
inlineoverridevirtualinherited

Reimplemented from AudioWriter.

Reimplemented in DecoderBasic, and OggContainerDecoder.

◆ clearNotifyAudioChange()

virtual void clearNotifyAudioChange ( )
inlinevirtualinherited

Deletes all change notify subscriptions.

Reimplemented in RTSPClient< TcpClient, UdpSocket >.

◆ decodeFrame()

void decodeFrame ( const uint8_t data,
size_t  frame_len 
)
inlineprotected

◆ end()

void end ( )
inlineoverridevirtual

Reimplemented from AudioDecoder.

◆ getOutput()

Print * getOutput ( )
inlineinherited

◆ isNotifyActive()

bool isNotifyActive ( )
inlineinherited

Checks if the automatic AudioInfo update is active.

◆ isResultPCM()

virtual bool isResultPCM ( )
inlinevirtualinherited

Returns true to indicate that the decoding result is PCM data.

Reimplemented in CopyDecoder, DecoderNetworkFormat, and ContainerM4A.

◆ notifyAudioChange()

void notifyAudioChange ( AudioInfo  info)
inlineprotectedinherited

◆ operator bool()

operator bool ( )
inlineoverridevirtual

Implements AudioWriter.

◆ processByte()

void processByte ( uint8_t  byte)
inlineprotected

◆ removeNotifyAudioChange()

virtual bool removeNotifyAudioChange ( AudioInfoSupport bi)
inlinevirtualinherited

Removes a target in order not to be notified about audio changes.

Reimplemented in RTSPClient< TcpClient, UdpSocket >.

◆ setAudioInfo()

void setAudioInfo ( AudioInfo  from)
inlineoverridevirtual

for most decoders this is not needed

Reimplemented from AudioDecoder.

◆ setCodecConfig()

virtual bool setCodecConfig ( const uint8_t data,
size_t  len 
)
inlinevirtualinherited

Some decoders need e.g. a magic cookie to provide the relevant info for decoding.

Reimplemented in DecoderALAC, and MultiDecoder.

◆ setNotifyActive()

void setNotifyActive ( bool  flag)
inlineinherited

Deactivate/Reactivate automatic AudioInfo updates: (default is active)

◆ setOutput() [1/3]

virtual void setOutput ( AudioOutput out_stream)
inlinevirtualinherited

Defines where the decoded result is written to.

Reimplemented in ADTSDecoder, CodecChain, MTSDecoder, MTSDecoderTSDemux, and MetaDataFilterDecoder.

◆ setOutput() [2/3]

virtual void setOutput ( AudioStream out_stream)
inlinevirtualinherited

Defines where the decoded result is written to.

Reimplemented in ADTSDecoder, CodecChain, MTSDecoder, MTSDecoderTSDemux, and MetaDataFilterDecoder.

◆ setOutput() [3/3]

void setOutput ( Print out_stream)
inlineoverridevirtual

Defines where the decoded result is written to.

Reimplemented from AudioDecoder.

◆ 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

◆ decoder_ctx

bcg729DecoderChannelContextStruct* decoder_ctx = nullptr
protected

◆ id

int id
inherited

custom id to be used by application

◆ info

AudioInfo info
protectedinherited

◆ input_buffer

Vector<uint8_t> input_buffer
protected

◆ input_pos

size_t input_pos = 0
protected

◆ is_active

bool is_active = false
protected

◆ is_notify_active

bool is_notify_active = true
protectedinherited

◆ notify_vector

Vector<AudioInfoSupport*> notify_vector
protectedinherited

◆ p_print

Print* p_print = nullptr
protected

◆ result_buffer

Vector<uint8_t> result_buffer
protected

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