#audio #sound #effects #rusty #sfx

rusty_audio

Convenient sound library for small projects and educational purposes

6 stable releases

✓ Uses Rust 2018 edition

new 1.1.4 Mar 25, 2020
1.1.3 Mar 15, 2020
1.1.1 Nov 20, 2019
1.1.0 Oct 10, 2019
1.0.0 Oct 10, 2019

#84 in Audio

Download history 10/week @ 2019-12-01 23/week @ 2019-12-08 3/week @ 2019-12-15 4/week @ 2019-12-22 2/week @ 2019-12-29 2/week @ 2020-01-05 6/week @ 2020-01-12 10/week @ 2020-01-19 1/week @ 2020-01-26 1/week @ 2020-02-02 7/week @ 2020-02-09 14/week @ 2020-02-16 22/week @ 2020-02-23 6/week @ 2020-03-01 11/week @ 2020-03-08 47/week @ 2020-03-15

55 downloads per month
Used in 2 crates

MIT/Apache

31KB
64 lines

rusty_audio

rusty_audio is a fun and easy audio library that provides a 4-track audio system to load/decode audio files and play them. Supported formats are: MP3, WAV, Vorbis and Flac.

This library is part of the rusty_engine game engine, but can be used as a standalone library as well. It uses the very powerful rodio audio playback library under the hood, which you should consider using directly if your needs are more complex.

Dependencies on Linux

rusty_audio should work out-of-the-box on macOS, Windows, iOS, and emscripten. For Linux, the downstream package for actually playing sound (CPAL requires the alsa development libraries to be installed.

CentOS

sudo yum install -y alsa-lib-devel

Debian/Ubuntu

sudo apt install libasound2-dev

lib.rs:

rusty_audio is a convenient sound library for small projects and educational purposes. For more elaborate needs, please use rodio, which is the much more powerful audio library that this one uses.

Example

use rusty_audio::Audio;
let mut audio = Audio::new();
audio.add("startup", "audio_subsystem_initialized.mp3");
audio.play("startup"); // Execution continues while playback occurs in another thread.
audio.wait(); // Block until no sounds are playing

Dependencies

~8MB
~18K SLoC