audio_processing_io library

File-backed audio processing utilities for Dart IO platforms.

Import package:audio_processing/audio_processing.dart when only portable processing APIs are needed. This library additionally exports the dart:io-backed WAV sink.

Classes

AdaptiveGain
Slow automatic gain control that amplifies quiet capture and never attenuates loud capture.
AdaptiveGainProcessor
AdaptiveGain as a graph stage, with one gain state per stream.
AecBlockAccumulator
Chops a float32 sample stream into fixed-size int16 blocks, carrying the remainder across calls.
AecDelayEstimate
Result of an AecDelayEstimator measurement.
AecDelayEstimator
Estimates the offset between a system-loopback ("far") and a microphone ("near") capture by cross-correlating their short-time energy envelopes on one shared clock.
AudioDownmixer
Stateful-per-track interleaved PCM to mono downmixer.
AudioFrameProcessor
Synchronous stateful transform that may emit zero or more frames per input.
AudioMeter
Per-track RMS/peak meter with time-based attack and release smoothing.
AudioMeterReading
Immutable level measurement for one audio frame.
AudioMixer
Explicit mixer for one SynchronizedAudioBlock.
AudioRechunker
Repackages arbitrary frame sizes into deterministic fixed-size chunks.
AudioResampler
Streaming linear-interpolation resampler with isolated state per track.
AudioRing
Fixed-capacity ring of mono samples addressed by an absolute write index.
AudioStreamKey
Stable key used to isolate transform state for simultaneous tracks.
AudioTimelineSynchronizer
Aligns independent tracks onto explicit fixed-size timeline blocks.
MultiTrackWavEncoder
Independent per-track collection of WavEncoder instances.
SynchronizedAudioBlock
One fixed-duration timeline block containing every configured track.
WavEncoder
In-memory streaming WAV encoder for one fixed-format audio track.
WavFileAudioSink
A single-use, bounded-memory WAV AudioSink backed by a local file.
WavFileAudioSinkSession
Prepared file-backed WAV recording session.
WavFileInfo
Parsed metadata from a canonical PCM WAV header.

Enums

AudioDownmixStrategy
Mono downmix weighting strategy.
AudioMixMode
Output normalization used by AudioMixer.
WavFileAbortPolicy
What a file-backed WAV sink does with accepted audio after an abort.
WavGapPolicy
How an encoder handles explicit or inferred timeline gaps.
WavSampleEncoding
PCM representation stored in a WAV data chunk.

Constants

kAecBlockFrames → const int
Sample frames in one 10 ms block at 16 kHz.

Functions

floatToPcm16(Float32List samples) Int16List
Converts float32 PCM in [-1, 1] to signed 16-bit PCM.
inspectWav(Uint8List bytes) WavFileInfo
Parses metadata from a canonical 44-byte PCM WAV header.
mixTracksToMono(List<Float32List> tracks) Float32List
Mixes complete mono tracks down to one, summing sample-for-sample and hard-clipping to [-1, 1].
pcm16ToFloat(Int16List samples) Float32List
Converts signed 16-bit PCM back to float32 in [-1, 1].
peakBuckets(Float32List samples, int bucketCount) List<double>
Reduces samples to bucketCount peak-amplitude buckets in [0, 1], suitable for drawing a waveform.

Exceptions / Errors

AudioSynchronizationFailure
Raised when bounded timeline alignment cannot continue safely.