arduino-audio-tools
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DecoderL8 Class Reference

DecoderL8 - Converts an 8 Bit Stream into 16Bits Most microcontrollers can not output 8 bit data directly. 8 bit data however is very memory efficient and helps if you need to store audio on constrained resources. This decoder translates 8bit data into 16bit 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 DecoderL8:
AudioDecoder AudioWriter AudioInfoSource

Public Member Functions

 DecoderL8 (bool isSigned=false)
 Construct a new DecoderL8 object.
 
 DecoderL8 (Print &out_stream, AudioInfoSupport &bi)
 Construct a new DecoderL8 object. More...
 
 DecoderL8 (Print &out_stream, bool active=true)
 Construct a new DecoderL8 object. More...
 
virtual AudioInfo audioInfo ()
 
void begin () override
 
void begin (AudioInfo info1) override
 
int16_t convertSample (int16_t in)
 
void end () override
 
virtual bool isResultPCM ()
 If true, the decoding result is PCM data.
 
virtual operator bool () override
 
virtual void setAudioInfo (AudioInfo from) override
 for most decoders this is not needed
 
void setNotifyAudioChange (AudioInfoSupport &notify) override
 Registers an object that is notified if the audio format is changing.
 
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.
 
virtual void setOutput (Print &out_stream) override
 Defines where the decoded result is written to.
 
void setSigned (bool isSigned)
 
virtual size_t write (const void *in_ptr, size_t in_size) override
 

Protected Member Functions

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

Protected Attributes

bool active
 
Vector< int16_t > buffer
 
AudioInfo info
 
bool is_signed = false
 
AudioInfoSupportp_notify = nullptr
 
Printp_print = nullptr
 

Detailed Description

DecoderL8 - Converts an 8 Bit Stream into 16Bits Most microcontrollers can not output 8 bit data directly. 8 bit data however is very memory efficient and helps if you need to store audio on constrained resources. This decoder translates 8bit data into 16bit 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

◆ DecoderL8() [1/2]

DecoderL8 ( Print out_stream,
bool  active = true 
)
inline

Construct a new DecoderL8 object.

Parameters
out_streamOutput Stream to which we write the decoded result

◆ DecoderL8() [2/2]

DecoderL8 ( Print out_stream,
AudioInfoSupport bi 
)
inline

Construct a new DecoderL8 object.

Parameters
out_streamOutput Stream to which we write the decoded result
biObject that will be notified about the Audio Formt (Changes)

Member Function Documentation

◆ setSigned()

void setSigned ( bool  isSigned)
inline

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


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