#audio #multimedia

nightly ez_audio

🔊 A easy to use audio playback library

7 releases

0.1.6 Jun 6, 2021
0.1.5 May 5, 2021
0.1.4 Apr 7, 2021

#129 in Audio

Download history 89/week @ 2021-04-06 10/week @ 2021-04-13 13/week @ 2021-04-20 5/week @ 2021-04-27 24/week @ 2021-05-04 7/week @ 2021-05-11 7/week @ 2021-05-18 3/week @ 2021-05-25 16/week @ 2021-06-01 11/week @ 2021-06-08 2/week @ 2021-06-15 4/week @ 2021-06-22 1/week @ 2021-06-29 2/week @ 2021-07-06 2/week @ 2021-07-13 11/week @ 2021-07-20

53 downloads per month
Used in harmony-rs

MIT license

655KB
4.5K SLoC

C 4K SLoC // 0.2% comments Rust 416 SLoC C++ 174 SLoC // 0.1% comments

ez-audio

Crates.io Docs.rs License: MIT
ez-audio is a easy to use audio playback library that uses the C library miniaudio as a backend.
Currently only compiles on nightly and a C++ compiler is required as it depends on the cc crate.

Supported Codecs

  • MP3
  • WAV
  • Vorbis
  • Flac

Examples

Minimal

    let context = Context::new().unwrap();
    let mut clip = AudioLoader::new("audio.mp3", context.clone())
        .load()
        .unwrap();

    clip.play();
    // loop forever to stop handle from being dropped
    loop {}

lib.rs:

ez-audio is a easy to use audio playback library that uses the C library miniaudio as a backend.

Examples

Minimal

let context = Context::new().unwrap();
let mut clip = AudioLoader::new("audio.mp3", context.clone())
    .load()
    .unwrap();

clip.play();
loop {}

With on end

let context = Context::new().unwrap();
let mut clip = AudioLoader::new("audio.mp3", context.clone())
    .user_data(10)
    .on_end(|data| {
        assert!(data == 10)
    })
    .load()
    .unwrap();

clip.play();
loop {}

No runtime deps