Rubato
Asynchronous and synchronous audio sample-rate conversion for Rust
Repository Health
Technical Analysis
Rubato is a flexible audio resampling library for Rust that converts audio between arbitrary sample rates, offering a choice of resampler implementations tuned for either high quality or high speed. It processes audio in chunks, making it equally suitable for offline batch conversion and real-time audio streams.
The library supports completely free selection of resampling ratios — including ratios that change on the fly, useful for clock-drift compensation in real-time audio pipelines. It ships both high-quality asynchronous sinc-based resamplers and fast synchronous FFT-based resamplers, and is designed to avoid allocations during processing so it can run predictably inside real-time audio callbacks.
What You Get
- Multiple resampler implementations: asynchronous sinc-based (quality-focused) and synchronous FFT-based (speed-focused)
- Arbitrary, freely selectable resampling ratios, including ratios that can be changed mid-stream
- Allocation-free processing paths designed for real-time audio callbacks
- Input/output handled via the
audioadaptercrate’sAdapter/AdapterMuttraits, supporting any sample layout or format - Chunked processing suitable for both offline batch conversion and streaming pipelines
Common Use Cases
- Resampling audio between a device’s native sample rate and an application’s internal processing rate
- Compensating for clock drift between audio input and output devices in real-time systems
- Converting sample rates in offline audio processing tools and format converters
- Building DAWs, audio plugins, or streaming pipelines that need high-quality variable-ratio resampling
Under The Hood
Architecture - The crate separates resampling strategies into distinct modules: asynchro_sinc.rs and asynchro_fast.rs implement the asynchronous (variable-ratio) sinc and simplified interpolators respectively, while synchro.rs implements the fixed-ratio FFT-based path built on realfft. Shared machinery — windowing functions (windows.rs), sinc-table generation (sinc.rs, sinc_interpolator/), and the core interpolation math (interpolation.rs) — is factored out so both resampler families reuse the same DSP building blocks, with sample.rs and error.rs rounding out the public data/error types.
Tech Stack - Rubato depends on realfft/num-complex (optional, gated behind the fft_resampler feature) for FFT-based resampling, num-integer/num-traits for generic numeric handling, and the sibling audioadapter/audioadapter-buffers crates for input/output buffer abstraction, letting callers supply audio in interleaved, planar, or custom layouts without the library needing to know the concrete buffer type.
Code Quality - The crate uses criterion for benchmarking resampler throughput (benches/resamplers.rs) and test-case/approx/test-log for parameterized numerical-accuracy tests, appropriate for a DSP library where correctness is measured against tolerance thresholds rather than exact equality. The codebase spans roughly 5,600 lines across a dozen focused modules, with error.rs providing typed errors instead of panics for invalid configuration.
API Design - Resampler types are constructed with explicit chunk-size and ratio parameters and implement a common processing interface, so switching between the sinc and FFT-based resamplers is largely a matter of swapping the constructor. The audioadapter abstraction is a deliberate design choice that adds a small conceptual step for newcomers (understanding Adapter/AdapterMut before you can pass in audio buffers) but pays off by decoupling the resampler from any single audio buffer representation.
Used by 6 apps in this directory
Anarlog
Note Taking · AI Assistants · Productivity
Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.
Epicenter
Knowledge Management · Note Taking · Developer Tools
A local-first monorepo led by Whispering, an open-source speech-to-text app, built on an MIT toolkit that turns your data into plain Markdown and SQLite files you own instead of a database you rent.
Handy
Productivity
Free, offline, open-source speech-to-text that pastes directly into any app on Windows, macOS, and Linux.
Meetily
Productivity · AI Assistants
Privacy-first AI meeting assistant that transcribes and summarizes your meetings entirely on your local machine — no cloud, no data leakage.
RustDesk
Networking
Open-source, self-hosted remote desktop built in Rust — your data, your infrastructure, no third-party cloud.
Spacedrive
File Storage · Collaboration
One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.