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

Minimal Print wrapper that counts the bytes actually written to the wrapped output. Used by WAVEncoder to track the number of encoded bytes an external AudioEncoderExt has emitted, since AudioEncoder::write() reports the number of raw PCM input bytes it accepted, not the number of encoded bytes it produced (these differ for compressing formats like ADPCM). More...

#include <CodecWAV.h>

Inheritance diagram for CountingPrint:
Print

Public Member Functions

virtual int availableForWrite ()
 
virtual void flush ()
 
void setOutput (Print *out)
 
size_t write (const uint8_t *data, size_t len) override
 
size_t write (uint8_t c) override
 

Public Attributes

size_t count = 0
 

Protected Attributes

int _timeout = 10
 
Printp_out = nullptr
 

Detailed Description

Minimal Print wrapper that counts the bytes actually written to the wrapped output. Used by WAVEncoder to track the number of encoded bytes an external AudioEncoderExt has emitted, since AudioEncoder::write() reports the number of raw PCM input bytes it accepted, not the number of encoded bytes it produced (these differ for compressing formats like ADPCM).

Author
Phil Schatzmann

Member Function Documentation

◆ availableForWrite()

virtual int availableForWrite ( )
inlinevirtualinherited

◆ flush()

virtual void flush ( )
inlinevirtualinherited

◆ setOutput()

void setOutput ( Print out)
inline

◆ write() [1/2]

size_t write ( const uint8_t *  data,
size_t  len 
)
inlineoverridevirtual

Reimplemented from Print.

◆ write() [2/2]

size_t write ( uint8_t  c)
inlineoverride

Member Data Documentation

◆ _timeout

int _timeout = 10
protectedinherited

◆ count

size_t count = 0

◆ p_out

Print* p_out = nullptr
protected

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