Skip to content

wavekat/wavekat-core

Repository files navigation

WaveKat Core

Crates.io docs.rs codecov

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

cargo add wavekat-core
use wavekat_core::AudioFrame;

// From f32 — zero-copy (slice, &Vec<f32>, or array)
let frame = AudioFrame::new(&f32_samples, 16000);

// From i16 — normalizes to f32 [-1.0, 1.0] automatically
let frame = AudioFrame::new(&i16_samples, 16000);

// From an owned Vec — zero-copy, produces AudioFrame<'static>
let frame = AudioFrame::from_vec(vec![0.0f32; 160], 16000);

// Inspect the frame
let samples: &[f32] = 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: AudioFrame<'static> = 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.

cargo add wavekat-core --features wav
use wavekat_core::AudioFrame;

// Read a WAV file (f32 or i16, normalized automatically)
let frame = AudioFrame::from_wav("input.wav")?;
println!("{} Hz, {} samples", frame.sample_rate(), frame.len());

// Write a frame to a WAV file (mono f32 PCM)
frame.write_wav("output.wav")?;

License

Licensed under Apache 2.0.

Copyright 2026 WaveKat.

About

Shared types for the WaveKat audio processing ecosystem. Common audio primitives (AudioFrame, IntoSamples) used across wavekat-vad, wavekat-turn, and other WaveKat crates.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors