TinyAudio
Minimal cross-platform audio output library for Rust across every major platform
Repository Health
Technical Analysis
TinyAudio is a small, cross-platform audio output library for Rust whose goal is to give you unified access to your operating system’s default sound output device as easily as possible. It covers desktop (Windows, Linux, macOS), mobile (Android, iOS), and WebAssembly from a single API.
The crate takes floating-point audio samples you prepare and streams them to the default device via a user-supplied callback, automatically converting to the platform’s native sample format and guaranteeing a fixed intermediate buffer size. It deliberately stays minimal: no format decoding, DSP, spatialization, device enumeration, or input capture — just the shortest path from your samples to the speakers. It is released under the MIT license.
What You Get
- Unified access to the OS default audio output device
- A callback-driven playback loop with guaranteed buffer sizes
- Automatic conversion from float samples to the platform format
- One API spanning desktop, mobile, and WebAssembly
Common Use Cases
- Playing synthesized or generated audio from a Rust program
- Providing sound output for a lightweight game or demo
- Prototyping DSP or synthesis code without a heavy audio stack
- Shipping the same audio output path across desktop, mobile, and web
Under The Hood
Architecture - TinyAudio creates a platform audio output context and drives it with a user-defined data callback that is invoked periodically to fill the next buffer with float samples; the crate converts those to the nearest platform-supported format and guarantees the requested buffer length. Playback continues until the device instance is dropped.
Tech Stack - Pure Rust with per-platform backends bridging to native audio APIs on Windows, Linux, macOS, Android, iOS, and WebAssembly; distributed as the tinyaudio crate on crates.io.
Code Quality - A deliberately small, single-purpose codebase with clear README documentation of exactly what it does and does not do; it has a modest contributor base and low recent commit activity.
API Design - The API is intentionally tiny: construct an output device with parameters and a sample-supplying closure, and playback starts — an ideal low-friction choice when you only need to get samples to the speakers.