Audio
Waveforms and features through the same matrix runtime.
OA Audio is a compact offline, batched, capture, playback, and media layer. It uses explicit Float32 channel-major buffers and composes with the Core, Vision, and ML modules.
15-operation verified sliceWAV · FLAC · MP3 decodeFloat32-first

Audio
Input and output
File decode
WAV, FLAC, and MP3 decode to semantic oa::Audio values backed by planar Float32 matrices with attached rate and channel layout.
Capture
A bounded real-time device ring publishes timestamped Float32 chunks without blocking the audio callback.
Playback
oa::AudioStream supports incremental decode, play, pause, seek, loop, and monotonic position tracking.
Encoding
Lossless WAV-F32 output is public; native AAC packetization is used by the media recorder. FLAC and Opus encoding remain roadmap work.
Verified operations
| Group | Operations |
|---|---|
| I/O | Load file or memory; save WAV-F32 |
| Signal | Gain, mix, fade, clip, pre-emphasis, mono, normalization, resampling |
| Features | STFT magnitude, mel spectrogram, MFCC, amplitude to dB |
| Interop | Zero-copy raw-audio matrix view |
Audio to model
STFT, mel, and MFCC outputs are ordinary oa::Matrix values. The feature path can therefore feed a model without a second tensor type or an adapter framework.
1auto decoded = oa::FnAudio::decodeFile("speech.flac");2if (not decoded.isOk()) return 1;34oa::Audio waveform = oa::FnAudio::resample(decoded.getValue(), 16000);5oa::Audio clean = oa::FnAudio::normalize(waveform, -6.0F);67oa::MelConfig melConfig{.fftSize = 512, .hopSize = 160, .numMels = 80};8oa::Matrix mel = oa::FnAudio::melSpectrogram(clean, melConfig);9
Media integration
Video sessions can open the first audio track from the same URI and preserve video-only operation when no compatible track exists. Capture and recording share timestamps with Vision; entropy codecs remain explicit CPU codec boundaries around Vulkan DSP.