#audio #playback #synthesizer

sys soloud-sys

Rust bindings for the soloud audio engine

20 releases (3 stable)

1.0.2 Feb 17, 2022
1.0.0 Oct 17, 2021
0.4.4 Oct 5, 2021
0.4.0 May 4, 2021
0.2.2 Nov 22, 2020

#141 in Audio

Download history 82/week @ 2022-04-13 86/week @ 2022-04-20 241/week @ 2022-04-27 358/week @ 2022-05-04 440/week @ 2022-05-11 205/week @ 2022-05-18 213/week @ 2022-05-25 287/week @ 2022-06-01 130/week @ 2022-06-08 102/week @ 2022-06-15 90/week @ 2022-06-22 116/week @ 2022-06-29 82/week @ 2022-07-06 101/week @ 2022-07-13 213/week @ 2022-07-20 177/week @ 2022-07-27

585 downloads per month
Used in 8 crates (via soloud)

MIT license

7MB
73K SLoC

C++ 45K SLoC // 0.1% comments C 22K SLoC // 0.0% comments Rust 3K SLoC // 0.0% comments Python 2K SLoC // 0.5% comments Lua 871 SLoC // 0.0% comments Ruby 102 SLoC // 0.1% comments C# 20 SLoC // 0.2% comments Batch 12 SLoC JavaScript 1 SLoC Shell 1 SLoC

soloud-sys

Raw bindings to soloud. These are generated using bindgen on the soloud C headers.

Usage

[dependencies]
soloud-sys = { version = "1", features = ["miniaudio"] }

Example code:

use soloud_sys::soloud::*;

fn main() {
    unsafe {
        let sl = Soloud_create();
        Soloud_init(sl);
        std::thread::sleep(std::time::Duration::from_millis(100));
        Soloud_setGlobalVolume(sl, 3.0);
    
        let speech = Speech_create();
    
        let ret = Speech_setText(speech, "Hello World\0".as_ptr() as _);
    
        dbg!(ret);

        Soloud_play(sl, speech);
        while Soloud_getVoiceCount(sl) > 0 {
            // calls to play are non-blocking, so we put the thread to sleep
            std::thread::sleep(std::time::Duration::from_millis(100));
        }
    }
}

lib.rs:

soloud-sys

Raw bindings to soloud. These are generated using bindgen on the soloud C headers.

Usage

[dependencies]
soloud-sys = { version = "1", features = ["miniaudio"] }

Example code:

use soloud_sys::soloud::*;

fn main() {
unsafe {
let sl = Soloud_create();
Soloud_init(sl);
std::thread::sleep(std::time::Duration::from_millis(100));
Soloud_setGlobalVolume(sl, 3.0);

let speech = Speech_create();

let ret = Speech_setText(speech, "Hello World\0".as_ptr() as _);

dbg!(ret);

Soloud_play(sl, speech);
while Soloud_getVoiceCount(sl) > 0 {
// calls to play are non-blocking, so we put the thread to sleep
std::thread::sleep(std::time::Duration::from_millis(100));
}
}
}

Dependencies