audio_samples_io
Fast and simple audio reading and writing in Rust
Rust crate providing audio file I/O utilities and helpers.
audio_samples_io is the I/O layer of the AudioSamples ecosystem. It builds on top of the representations provided by audio_samples to provide reading, writing, and streaming for WAV and FLAC files.
The AudioSamples Ecosystem
audio_samples
├── core types, signal generation, DSP, analysis
├── audio_samples_io
│ └── file I/O: read and write WAV and FLAC
├── audio_samples_python
│ └── python bindings via PyO3
├── audio_samples_streaming
│ └── streaming pipeline, device I/O, rodio, async
└── audio_samples_ml
└── STT and TTS integrations
| Crate | What it provides | Start here if... |
|---|---|---|
audio_samples |
AudioSamples<T>, core types, signal generation, DSP, analysis |
You need in-memory audio representations or signal processing primitives |
audio_samples_io |
Read and write WAV and FLAC files | You need to load or save audio files with minimal setup |
audio_samples_python |
Python bindings via PyO3 and NumPy interop | You want to use the library from Python or integrate with Python workflows |
audio_samples_streaming |
Chunk-based streaming, real-time device I/O, async pipelines | You need real-time audio processing or streaming pipelines |
audio_samples_ml |
Speech-to-text (STT) and text-to-speech (TTS) integrations | You want to integrate transcription or synthesis into your audio pipeline |
NOTE: Still under development
Currently supports .wav and .flac files.
Planned:
- mp3
- aiff
- ogg
- aac
Quick start
Install via:
use Duration;
use AudioIOResult;
use ;
Benchmarks
Checkout the wav benchmark summary doc for a comparison against Hound and libsndfile. Check out flac benchmark summary
To run the benchmarks (Criterion) reading and writing.
I have included a small benchmark reported binary for collating benchmarks to a markdown file
Output files
benchmark_report.md— Markdown summary generated by the reporter binarybenchmark_results.csv— Detailed CSV export of benchmark rows (times in μs)benchmark_summary.csv— Executive summary CSV
License
MIT License
Contributing
Contributions are welcome. Please submit a pull request and see CONTRIBUTING.md for guidance.
Citing
If you use AudioSamples in research, please cite: