Safe Rust port of Sonic, the pitch-synchronous speech speed, pitch and volume changer by Bill Cox. No unsafe, no C toolchain, no dependencies.
[dependencies]
libsonic = "0.1"use libsonic::SonicStream;
let mut stream = SonicStream::new(22_050, 1)?;
stream.set_speed(1.5);
stream.write_f32(&samples);
stream.flush();
let frames = stream.available_frames();
let faster = stream.read_f32(frames);- Float input and output, speed, pitch and volume. Sample rate 1000..=500000 Hz, 1..=32 channels.
- Output is sample-exact with
sonic.c(quality 0, chord pitch off) over the matrix frozen intests/sonic_golden.tsv. - Not ported: chord pitch, quality mode, the
short/ucharentry points, spectrograms and the microcontroller variants.
cargo test
cargo bench
If this repository saves you time and effort, please consider supporting it!
Apache-2.0. See LICENSE and NOTICE.
pip install libsonic installs the same stream API as a prebuilt wheel; see python/README.md.