#sound #effects #sfx #rusty


Convenient sound library for small projects and educational purposes

12 stable releases

1.4.1 Apr 10, 2023
1.4.0 Jun 13, 2022
1.2.1 Mar 15, 2021
1.1.5 Feb 27, 2021
1.1.0 Oct 10, 2019

#26 in Audio

Download history 466/week @ 2023-08-09 522/week @ 2023-08-16 264/week @ 2023-08-23 645/week @ 2023-08-30 545/week @ 2023-09-06 502/week @ 2023-09-13 291/week @ 2023-09-20 266/week @ 2023-09-27 327/week @ 2023-10-04 472/week @ 2023-10-11 651/week @ 2023-10-18 618/week @ 2023-10-25 600/week @ 2023-11-01 577/week @ 2023-11-08 478/week @ 2023-11-15 554/week @ 2023-11-22

2,281 downloads per month
Used in 3 crates


92 lines

Crates.io Version Crates.io Downloads Build Status

Rusty Audio Playback Library

rusty_audio is a fun and easy audio playback library that provides a 4-track audio system to load/decode audio files and play them, perfect for small projects. It is also well-suited for training purposes, and is featured in the Ultimate Rust Crash Course on Udemy.

  • Formats: MP3, WAV, Vorbis and Flac.
  • Platforms: Supports macOS, Windows, and iOS out of the box. Linux requires installation of extra dependencies.

This library uses the rodio audio playback library under the hood, which you should consider using directly if your needs are more complex.


# Add this to your [dependencies] section in Cargo.toml
rusty_audio = "1.4.1"
// main.rs
use rusty_audio::Audio;

fn main() {
    let mut audio = Audio::new();
    audio.add("startup", "my_sound_file.mp3"); // Load the sound, give it a name
    audio.play("startup"); // Execution continues while playback occurs in another thread.
    audio.wait(); // Block until sounds finish playing

Built-in Example

You can run the built-in example by cloning this repository, and then running:

$ cargo run --example play

Dependencies on Linux

For Linux, the CPAL package that is used under the hood requires the alsa development libraries to be installed.


sudo yum install -y alsa-lib-devel


sudo apt install libasound2-dev


All contributions are assumed to be dual-licensed under MIT/Apache-2.


Distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See license/APACHE and license/MIT.


If you like Rusty Audio, please consider sponsoring me on GitHub. 💖


~471K SLoC