arduino-audio-tools
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Variables
CodecWAV.h File Reference
#include "AudioTools/AudioCodecs/AudioCodecsBase.h"
#include "AudioTools/AudioCodecs/AudioEncoded.h"
#include "AudioTools/AudioCodecs/AudioFormat.h"
#include "AudioTools/CoreAudio/AudioBasic/StrView.h"

Go to the source code of this file.

Classes

class  CountingPrint
 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...
 
struct  WAVDecoder::DecoderEntry
 Associates a WAV format tag with the decoder responsible for it. More...
 
struct  WAVAudioInfo
 Sound information which is available in the WAV header. More...
 
class  WAVDecoder
 A simple WAVDecoder: We parse the header data on the first record to determine the format. If no AudioDecoderExt is specified we just write the PCM data to the output that is defined by calling setOutput(). You can define a ADPCM decoder to decode WAV files that contain ADPCM data. Since WAV files can use different ADPCM (or other) encodings, you can register more than one decoder with addDecoder(): the decoder matching the format tag found in the WAV header is selected automatically when a file is parsed. More...
 
class  WAVEncoder
 A simple WAV file encoder. If no AudioEncoderExt is specified the WAV file contains PCM data, otherwise it is encoded as ADPCM. The WAV header is written with the first writing of audio data. Calling begin() is making sure that the header is written again. More...
 
class  WAVHeader
 Parser for Wav header data for details see https://de.wikipedia.org/wiki/RIFF_WAVE. More...
 

Namespaces

namespace  audio_tools
 Generic Implementation of sound input and output for desktop environments using portaudio.
 

Macros

#define MAX_WAV_HEADER_LEN   200
 
#define MAX_WAV_HEADER_LEN_LIMIT   2048
 
#define READ_BUFFER_SIZE   512
 
#define WAV_ENCODER_COMPRESSED_CHUNK_SIZE   1024
 

Variables

static const char * wav_mime = "audio/wav"
 

Macro Definition Documentation

◆ MAX_WAV_HEADER_LEN

#define MAX_WAV_HEADER_LEN   200

◆ MAX_WAV_HEADER_LEN_LIMIT

#define MAX_WAV_HEADER_LEN_LIMIT   2048

Hard upper bound the header buffer may grow to while searching for the 'data' chunk tag (e.g. because of LIST/bext/other metadata chunks before 'data'). Protects against an unbounded/never-ending search on malformed input.

◆ READ_BUFFER_SIZE

#define READ_BUFFER_SIZE   512

◆ WAV_ENCODER_COMPRESSED_CHUNK_SIZE

#define WAV_ENCODER_COMPRESSED_CHUNK_SIZE   1024

Granularity (in bytes, rounded down to a whole number of frames) in which WAVEncoder feeds PCM data to an external (compressing) encoder when a fixed data_length was declared via setDataLength(). Smaller values make the point at which data_length is reached more precise (see WAVEncoder::write()) at the cost of more, smaller writes to the encoder.