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

Decoder for Codec2. Depends on https://github.com/pschatzmann/arduino-libcodec2. More...

#include <CodecCodec2.h>

Inheritance diagram for audio_tools::Codec2Decoder:
audio_tools::AudioDecoder audio_tools::AudioWriter audio_tools::AudioBaseInfoSource

Public Member Functions

virtual AudioBaseInfo audioInfo ()
 
virtual void begin ()
 
virtual void begin (AudioBaseInfo cfg)
 
int bitsPerSecond ()
 
virtual void end ()
 
 operator bool ()
 
virtual void setAudioInfo (AudioBaseInfo cfg)
 
virtual void setBitsPerSecond (int bps)
 sets bits per second: 3200, 2400, 1600, 1400, 1300, 1200, 700 and 450 bit/s
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi)
 
virtual void setOutputStream (Print &out_stream)
 
virtual size_t write (const void *data, size_t length)
 
- Public Member Functions inherited from audio_tools::AudioDecoder
 AudioDecoder (AudioDecoder const &)=delete
 
virtual AudioBaseInfo audioInfo ()=0
 
virtual bool isResultPCM ()
 
AudioDecoderoperator= (AudioDecoder const &)=delete
 
virtual void setAudioInfo (AudioBaseInfo from) override
 
virtual void setOutputStream (AudioPrint &out_stream)
 
virtual void setOutputStream (AudioStream &out_stream)
 
virtual void setOutputStream (Print &out_stream) override=0
 
virtual void begin ()=0
 
virtual void end ()=0
 
virtual operator bool ()=0
 
virtual void setAudioInfo (AudioBaseInfo from)=0
 
virtual void setOutputStream (Print &out_stream)=0
 
virtual size_t write (const void *in_ptr, size_t in_size)=0
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi)=0
 

Protected Member Functions

void processByte (uint8_t byte)
 Build decoding buffer and decode when frame is full.
 

Protected Attributes

int bits_per_second =2400
 
AudioBaseInfo cfg
 
Vector< uint8_t > input_buffer
 
int input_pos = 0
 
bool is_active = false
 
struct CODEC2 * p_codec2
 
AudioBaseInfoDependentp_notify = nullptr
 
Printp_print = nullptr
 
Vector< int16_t > result_buffer
 

Detailed Description

Decoder for Codec2. Depends on https://github.com/pschatzmann/arduino-libcodec2.

Author
Phil Schatzmann

Member Function Documentation

◆ audioInfo()

virtual AudioBaseInfo audio_tools::Codec2Decoder::audioInfo ( )
inlinevirtual

◆ begin()

virtual void audio_tools::Codec2Decoder::begin ( )
inlinevirtual

◆ end()

virtual void audio_tools::Codec2Decoder::end ( )
inlinevirtual

◆ operator bool()

audio_tools::Codec2Decoder::operator bool ( )
inlinevirtual

◆ setAudioInfo()

virtual void audio_tools::Codec2Decoder::setAudioInfo ( AudioBaseInfo  cfg)
inlinevirtual

Reimplemented from audio_tools::AudioDecoder.

◆ setNotifyAudioChange()

virtual void audio_tools::Codec2Decoder::setNotifyAudioChange ( AudioBaseInfoDependent bi)
inlinevirtual

◆ setOutputStream()

virtual void audio_tools::Codec2Decoder::setOutputStream ( Print out_stream)
inlinevirtual

◆ write()

virtual size_t audio_tools::Codec2Decoder::write ( const void *  data,
size_t  length 
)
inlinevirtual

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