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

Encoder for SBC - Depends on https://github.com/pschatzmann/arduino-libsbc. Inspired by sbcenc.c. More...

#include <CodecSBC.h>

Inheritance diagram for audio_tools::SBCEncoder:
audio_tools::AudioEncoder audio_tools::AudioWriter

Public Member Functions

 SBCEncoder (int resultBufferSize=1024, int subbands=SBC_SB_8, int blocks=16, int bitpool=32, int snr=SBC_AM_LOUDNESS)
 
void begin ()
 
void begin (AudioBaseInfo bi)
 
virtual void end ()
 
virtual const char * mime ()
 
 operator bool ()
 
virtual void setAudioInfo (AudioBaseInfo info)
 
virtual void setOutputStream (Print &out_stream)
 
virtual size_t write (const void *in_ptr, size_t in_size)
 
- Public Member Functions inherited from audio_tools::AudioEncoder
 AudioEncoder (AudioEncoder const &)=delete
 
virtual const char * mime ()=0
 
AudioEncoderoperator= (AudioEncoder const &)=delete
 
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
 

Protected Member Functions

void processByte (uint8_t byte)
 
bool setup ()
 Determines audio information and calls sbc_init;.
 

Protected Attributes

int bitpool = 32
 
int blocks = 4
 
uint8_t * buffer = nullptr
 
int buffer_pos = 0
 
int current_codesize = 0
 
AudioBaseInfo info
 
bool is_active = false
 
bool is_first = true
 
Printp_print = nullptr
 
uint8_t * result_buffer = nullptr
 
int result_buffer_size = 0
 
int result_size = 0
 
sbc_t sbc
 
int snr
 
int subbands = 4
 

Detailed Description

Encoder for SBC - Depends on https://github.com/pschatzmann/arduino-libsbc. Inspired by sbcenc.c.

Author
Phil Schatzmann

Member Function Documentation

◆ begin()

void audio_tools::SBCEncoder::begin ( )
inlinevirtual

◆ end()

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

◆ mime()

virtual const char * audio_tools::SBCEncoder::mime ( )
inlinevirtual

◆ operator bool()

audio_tools::SBCEncoder::operator bool ( )
inlinevirtual

◆ setAudioInfo()

virtual void audio_tools::SBCEncoder::setAudioInfo ( AudioBaseInfo  info)
inlinevirtual

◆ setOutputStream()

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

◆ write()

virtual size_t audio_tools::SBCEncoder::write ( const void *  in_ptr,
size_t  in_size 
)
inlinevirtual

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