wavekat_core/lib.rs
1//! Shared types for the WaveKat audio processing ecosystem.
2//!
3//! This crate provides the common audio primitives used across all WaveKat
4//! crates (`wavekat-vad`, `wavekat-turn`, `wavekat-voice`, etc.).
5//!
6//! # Audio Format Standard
7//!
8//! The WaveKat ecosystem standardizes on **16 kHz, mono, f32 `[-1.0, 1.0]`**
9//! as the internal audio format. [`AudioFrame`] accepts both `i16` and `f32`
10//! input transparently via [`IntoSamples`].
11//!
12//! ```
13//! use wavekat_core::AudioFrame;
14//!
15//! // From f32 — zero-copy
16//! let f32_data = vec![0.0f32; 160];
17//! let frame = AudioFrame::new(&f32_data, 16000);
18//!
19//! // From i16 — converts automatically
20//! let i16_data = vec![0i16; 160];
21//! let frame = AudioFrame::new(&i16_data, 16000);
22//!
23//! assert_eq!(frame.sample_rate(), 16000);
24//! assert_eq!(frame.len(), 160);
25//! ```
26
27mod audio;
28
29pub use audio::{AudioFrame, IntoSamples};