Expand description
WAV file reading and writing for audio recording and playback.
Supports 16-bit PCM mono WAV files at any sample rate (typically 8000 Hz for telephony).
Structs§
- Audio
Recorder - An audio recorder that accumulates PCM samples.
- WavHeader
- WAV file header parameters
Enums§
Functions§
- compute_
snr - Compute the signal-to-noise ratio (SNR) in dB between original and received audio. Higher values mean better fidelity. Typical telephony: >20 dB is acceptable.
- cross_
correlation - Compute normalized cross-correlation between two signals. Returns a value between -1.0 and 1.0. Values > 0.9 indicate strong similarity.
- decode_
wav - Read PCM samples from WAV bytes.
- encode_
wav - Write PCM samples to a WAV file (in memory as bytes).
- generate_
multi_ tone - Generate a multi-tone signal with distinct frequencies (for fidelity testing).
- generate_
sine_ tone - Generate a sine wave tone (for testing).
- max_
sample_ error - Compute the maximum absolute sample-by-sample error.
- read_
wav - Read PCM samples from a WAV file on disk.
- rms_
error - Compute root-mean-square error between two signals.
- write_
wav - Write PCM samples to a WAV file on disk.