Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NumberFormatConverterStreamT< TFrom, TTo > Class Template Reference

Converter which converts from source bits_per_sample to target bits_per_sample. More...

#include <AudioStreamsConverter.h>

Inheritance diagram for NumberFormatConverterStreamT< TFrom, TTo >:
ReformatBaseStream AudioStream Stream AudioInfoSupport AudioInfoSource Print

Public Member Functions

 NumberFormatConverterStreamT (Print &print)
 NumberFormatConverterStreamT (Stream &stream)
virtual AudioInfo audioInfo () override
virtual int available () override
virtual int availableForWrite () override
bool begin () override
virtual void end ()
virtual void flush () override
virtual PrintgetPrint ()
virtual StreamgetStream ()
 operator bool ()
size_t readBytes (uint8_t *data, size_t size) override
virtual size_t readSilence (uint8_t *buffer, size_t length)
 Source to generate silence: just sets the buffer to 0.
virtual void setAudioInfo (AudioInfo info) override
void setBuffered (bool flag)
virtual void setNotifyAudioChange (AudioInfoSupport &bi) override
virtual void setStream (Print &print)
virtual void setStream (Stream &stream)
void setupReader ()
virtual bool validate (AudioInfo &info)
virtual size_t write (const uint8_t *data, size_t size) override
virtual size_t write (uint8_t ch) override
virtual void writeSilence (size_t len)
 Writes len bytes of silence (=0).

Protected Member Functions

virtual int not_supported (int out, const char *msg="")
void refillReadBuffer ()

Protected Attributes

SingleBuffer< uint8_t > buffer {0}
float factor
AudioInfo info
bool is_buffered = false
AudioInfoSupportp_notify =nullptr
Printp_print = nullptr
Streamp_stream = nullptr
TransformationReader< ReformatBaseStreamreader
RingBuffer< uint8_t > tmp_in {0}
RingBuffer< uint8_t > tmp_out {0}

Detailed Description

template<typename TFrom, typename TTo>
class audio_tools::NumberFormatConverterStreamT< TFrom, TTo >

Converter which converts from source bits_per_sample to target bits_per_sample.

Phil Schatzmann
Template Parameters
Tspecifies the current data type for the result of the read or write.
TArgis the data type of the Stream or Print Object that is passed in the Constructor

Member Function Documentation

◆ setBuffered()

void setBuffered ( bool  flag)

if set to true we do one big write, else we get a lot of single writes per sample

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