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

EncoderL8s - Condenses 16 bit PCM data stream to 8 bits data. Most microcontrollers can not process 8 bit audio data directly. 8 bit data however is very memory efficient and helps if you need to store audio on constrained resources. This encoder translates 16bit data into 8bit data. By default the encoded data is represented as uint8_t, so the values are from 0 to 255. More...

#include <CodecL8.h>

Inheritance diagram for EncoderL8:
AudioEncoder AudioWriter AudioInfoSupport

Public Member Functions

 EncoderL8 (bool isSigned=false)
 
 EncoderL8 (Print &out)
 
AudioInfo audioInfo () override
 provides the actual input AudioInfo
 
virtual AudioInfo audioInfoOut ()
 
bool begin () override
 starts the processing using the actual RAWAudioInfo
 
virtual bool begin (AudioInfo info)
 
bool begin (Print &out)
 starts the processing
 
int16_t convertSample (int16_t sample)
 
void end () override
 stops the processing
 
virtual uint32_t frameDurationUs ()
 Optional rtsp function: provide the frame duration in microseconds.
 
bool isOpen ()
 
const charmime () override
 Provides "audio/pcm".
 
 operator bool () override
 
virtual uint16_t samplesPerFrame ()
 Optional rtsp function: provide samples per the frame.
 
void setAudioInfo (AudioInfo from) override
 Defines the sample rate, number of channels and bits per sample.
 
void setOutput (Print &out_stream) override
 Defines the output Stream.
 
void setSigned (bool isSigned)
 By default the encoded values are unsigned, but can change them to signed.
 
size_t write (const uint8_t *data, size_t len) override
 Writes PCM data to be encoded as RAW.
 

Protected Member Functions

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

Protected Attributes

Vector< int8_tbuffer
 
AudioInfo info
 
bool is_open
 
bool is_signed = false
 
Printp_print = nullptr
 

Detailed Description

EncoderL8s - Condenses 16 bit PCM data stream to 8 bits data. Most microcontrollers can not process 8 bit audio data directly. 8 bit data however is very memory efficient and helps if you need to store audio on constrained resources. This encoder translates 16bit data into 8bit data. By default the encoded data is represented as uint8_t, so the values are from 0 to 255.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ EncoderL8() [1/2]

EncoderL8 ( bool  isSigned = false)
inline

◆ EncoderL8() [2/2]

EncoderL8 ( Print out)
inline

Member Function Documentation

◆ audioInfo()

AudioInfo audioInfo ( )
inlineoverridevirtualinherited

provides the actual input AudioInfo

Implements AudioInfoSupport.

Reimplemented in CodecNOP, BinaryContainerEncoder, and MP3ParserEncoder.

◆ audioInfoOut()

virtual AudioInfo audioInfoOut ( )
inlinevirtualinherited

◆ begin() [1/3]

bool begin ( )
inlineoverridevirtual

starts the processing using the actual RAWAudioInfo

Implements AudioWriter.

◆ begin() [2/3]

virtual bool begin ( AudioInfo  info)
inlinevirtualinherited

◆ begin() [3/3]

bool begin ( Print out)
inline

starts the processing

◆ convertSample()

int16_t convertSample ( int16_t  sample)
inline

◆ end()

void end ( )
inlineoverridevirtual

stops the processing

Implements AudioWriter.

◆ frameDurationUs()

virtual uint32_t frameDurationUs ( )
inlinevirtualinherited

Optional rtsp function: provide the frame duration in microseconds.

Reimplemented in ADPCMEncoder, OpusOggEncoder, MP3ParserEncoder, and MetaDataFilterEncoder.

◆ isOpen()

bool isOpen ( )
inline

◆ mime()

const char * mime ( )
inlineoverridevirtual

Provides "audio/pcm".

Implements AudioEncoder.

◆ operator bool()

operator bool ( )
inlineoverridevirtual

Implements AudioWriter.

◆ samplesPerFrame()

virtual uint16_t samplesPerFrame ( )
inlinevirtualinherited

Optional rtsp function: provide samples per the frame.

Reimplemented in MP3ParserEncoder, and MetaDataFilterEncoder.

◆ setAudioInfo()

void setAudioInfo ( AudioInfo  from)
inlineoverridevirtualinherited

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

Implements AudioWriter.

Reimplemented in MP3EncoderLAME, EncoderBasic, CodecChain, FLACEncoder, OpusAudioEncoder, WAVEncoder, CodecNOP, G7xxEncoder, BinaryContainerEncoder, OggContainerEncoder, OSCContainerEncoder, and MetaDataFilterEncoder.

◆ setOutput()

void setOutput ( Print out_stream)
inlineoverridevirtual

Defines the output Stream.

Reimplemented from AudioEncoder.

◆ setSigned()

void setSigned ( bool  isSigned)
inline

By default the encoded values are unsigned, but can change them to signed.

◆ write()

size_t write ( const uint8_t data,
size_t  len 
)
inlineoverridevirtual

Writes PCM data to be encoded as RAW.

Implements AudioWriter.

◆ writeBlocking()

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

Member Data Documentation

◆ buffer

Vector<int8_t> buffer
protected

◆ info

AudioInfo info
protectedinherited

◆ is_open

bool is_open
protected

◆ is_signed

bool is_signed = false
protected

◆ p_print

Print* p_print = nullptr
protected

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