Skip to content

0.4.0 — the recording era begins

Choose a tag to compare

@Neksand Neksand released this 10 Nov 18:23
· 20 commits to master since this release

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.md at the repository root: module map, commands, invariants, traps.
  • docs/llms.txt plus a markdown twin for every docs page (.html.md), linked with rel="alternate" and rel="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.