No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
audio_tools::WAVEncoder Class Reference

A simple WAV file encoder. More...

#include <CodecWAV.h>

Inheritance diagram for audio_tools::WAVEncoder:
audio_tools::AudioEncoder audio_tools::AudioWriter

Public Member Functions

 WAVEncoder (Stream &out)
 WAVEncoder (Stream &out, WAVAudioInfo ai)
virtual void begin ()
 starts the processing using the actual WAVAudioInfo More...
void begin (Stream &out, WAVAudioInfo &ai)
 starts the processing
void begin (WAVAudioInfo &ai)
 starts the processing
WAVAudioInfo defaultConfig ()
void end ()
 stops the processing More...
bool isOpen ()
const char * mime ()
 Provides "audio/wav". More...
 operator bool ()
virtual void setAudioInfo (AudioBaseInfo from)
 Update actual WAVAudioInfo. More...
virtual void setAudioInfo (WAVAudioInfo ai)
 Defines the WAVAudioInfo.
void setDataOffset (uint16_t offset)
 Adds adds n empty bytes at the beginning of the data.
void setOutputStream (Print &out)
 Defines the otuput stream. More...
virtual size_t write (const void *in_ptr, size_t in_size)
 Writes PCM data to be encoded as WAV. More...
void writeHeader (Print *out)
- 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 write16 (Print &stream, uint16_t value)
void write32 (Print &stream, uint64_t value)
void writeDataHeader (Print *stream_ptr)
void writeFMT (Print *stream_ptr)
void writeRiffHeader (Print *stream_ptr)

Protected Attributes

WAVAudioInfo audioInfo = defaultConfig()
bool header_written = false
volatile bool is_open
uint32_t offset =0
int64_t size_limit

Detailed Description

A simple WAV file encoder.

Phil Schatzmann

Member Function Documentation

◆ begin()

virtual void audio_tools::WAVEncoder::begin ( )

starts the processing using the actual WAVAudioInfo

Implements audio_tools::AudioWriter.

◆ end()

void audio_tools::WAVEncoder::end ( )

stops the processing

Implements audio_tools::AudioWriter.

◆ mime()

const char * audio_tools::WAVEncoder::mime ( )

Provides "audio/wav".

Implements audio_tools::AudioEncoder.

◆ operator bool()

audio_tools::WAVEncoder::operator bool ( )

◆ setAudioInfo()

virtual void audio_tools::WAVEncoder::setAudioInfo ( AudioBaseInfo  from)

Update actual WAVAudioInfo.

Implements audio_tools::AudioWriter.

◆ setOutputStream()

void audio_tools::WAVEncoder::setOutputStream ( Print out)

Defines the otuput stream.

Implements audio_tools::AudioWriter.

◆ write()

virtual size_t audio_tools::WAVEncoder::write ( const void *  in_ptr,
size_t  in_size 

Writes PCM data to be encoded as WAV.

Implements audio_tools::AudioWriter.

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