Repository navigation
0.4.0 — the recording era begins
Writing comes to sound_rs: record, then save, without leaving the library.
Write WAV
audio, rate = sound_rs.load("take.flac") # (frames, channels)
sound_rs.write("take.wav", audio, rate, subtype="pcm24")Subtypes pcm16, pcm24, float32. The array layout matches load, so a load/write round-trip needs no transpose. RIFF is written by hand — no encoder crate, no system dependency. Samples outside −1…1 are clipped; a non-WAV extension or unknown subtype raises SoundRsError(code="usage").
Record straight to a file
with sound_rs.Recorder() as recorder:
recorder.record_to("take.wav", 5.0)Non-contiguous arrays like audio[:, 0] now work in write and play_array; they used to raise "not contiguous".
For coding agents
AGENTS.mdat the repository root: module map, commands, invariants, traps.docs/llms.txtplus a markdown twin for every docs page (.html.md), linked withrel="alternate"andrel="describedby". Start at https://neksand.github.io/sound_rs/llms.txt- Docs version now comes from
Cargo.toml, so it cannot drift.
Verification: 39 Rust tests (including WAV round-trips for every subtype), clippy and fmt clean, Python smoke with real recording, decode hashes unchanged.
Note: GitHub Actions macOS runners were partially down during the release, so the macOS arm64 wheel was built locally and all six files were uploaded by hand.