Shared types for the WaveKat audio processing ecosystem.
[!WARNING] Early development. API may change.
What's Inside
| Type | Description |
|---|---|
AudioFrame |
Audio samples with sample rate, accepts i16 and f32 in slice, Vec, or array form |
IntoSamples |
Trait for transparent sample format conversion |
Quick Start
use AudioFrame;
// From f32 — zero-copy (slice, &Vec<f32>, or array)
let frame = new;
// From i16 — normalizes to f32 [-1.0, 1.0] automatically
let frame = new;
// From an owned Vec — zero-copy, produces AudioFrame<'static>
let frame = from_vec;
// Inspect the frame
let samples: & = frame.samples;
let rate: u32 = frame.sample_rate;
let n: usize = frame.len;
let empty: bool = frame.is_empty;
let secs: f64 = frame.duration_secs;
// Convert a borrowed frame to owned
let owned: = frame.into_owned;
Audio Format Standard
The WaveKat ecosystem standardizes on 16 kHz, mono, f32 [-1.0, 1.0].
AudioFrame handles the conversion so downstream crates don't have to.
Your audio (any format)
|
v
AudioFrame::new(samples, sample_rate)
|
+---> wavekat-vad
+---> wavekat-turn
+---> wavekat-asr (future)
Optional Features
wav
Adds WAV file I/O via hound.
use AudioFrame;
// Read a WAV file (f32 or i16, normalized automatically)
let frame = from_wav?;
println!;
// Write a frame to a WAV file (mono f32 PCM)
frame.write_wav?;
resample
Adds sample-rate conversion via rubato (high-quality sinc interpolation).
use AudioFrame;
// Resample a 44.1 kHz frame to 24 kHz for TTS
let frame = from_vec;
let frame = frame.resample?;
assert_eq!;
// No-op if already at the target rate
let same = frame.resample?;
License
Licensed under Apache 2.0.
Copyright 2026 WaveKat.