{"id":13621329,"url":"https://github.com/MoAlyousef/soloud-rs","last_synced_at":"2025-04-15T01:32:05.416Z","repository":{"id":44580083,"uuid":"289979846","full_name":"MoAlyousef/soloud-rs","owner":"MoAlyousef","description":"Rust bindings for the soloud audio engine library","archived":false,"fork":false,"pushed_at":"2024-04-18T19:56:35.000Z","size":202,"stargazers_count":57,"open_issues_count":4,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-30T04:50:13.424Z","etag":null,"topics":["audio","bindings","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MoAlyousef.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-24T16:25:20.000Z","updated_at":"2024-05-01T19:15:04.000Z","dependencies_parsed_at":"2024-01-14T06:58:34.972Z","dependency_job_id":"3058430f-cb03-4209-89d2-c7e48e9ebf5f","html_url":"https://github.com/MoAlyousef/soloud-rs","commit_stats":{"total_commits":116,"total_committers":4,"mean_commits":29.0,"dds":0.09482758620689657,"last_synced_commit":"ab6d54955115ee78bfdd315cf7fdcf138a2ffb37"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoAlyousef%2Fsoloud-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoAlyousef%2Fsoloud-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoAlyousef%2Fsoloud-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoAlyousef%2Fsoloud-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoAlyousef","download_url":"https://codeload.github.com/MoAlyousef/soloud-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223654594,"owners_count":17180540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","bindings","rust"],"created_at":"2024-08-01T21:01:04.812Z","updated_at":"2025-04-15T01:32:05.409Z","avatar_url":"https://github.com/MoAlyousef.png","language":"Rust","funding_links":[],"categories":["Libraries"],"sub_categories":["Audio and Music"],"readme":"# soloud-rs\n\n[![Documentation](https://docs.rs/soloud/badge.svg)](https://docs.rs/soloud)\n[![Crates.io](https://img.shields.io/crates/v/soloud.svg)](https://crates.io/crates/soloud)\n[![License](https://img.shields.io/crates/l/soloud.svg)](https://github.com/MoAlyousef/soloud-rs/blob/master/LICENSE)\n[![Build](https://github.com/MoAlyousef/soloud-rs/workflows/Build/badge.svg)](https://github.com/MoAlyousef/soloud-rs/actions)\n\nA crossplatform Rust bindings for the soloud audio engine library.\n\nSupported formats: wav, mp3, ogg, flac. The library also comes with a speech synthesizer.\n\n- The official soloud [website](https://sol.gfxile.net/soloud/index.html)\n- The official soloud [repo](https://github.com/jarikomppa/soloud)\n\n## Usage\n```toml\n[dependencies]\nsoloud = \"1.1\"\n```\n\nOr to use the git repo:\n```toml\n[dependencies]\nsoloud = { git = \"https://github.com/moalyousef/soloud-rs\" }\n```\n\nTo play audio:\n```rust,no_run\nuse soloud::*;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let mut sl = Soloud::default()?;\n\n    let mut wav = audio::Wav::default();\n\n    wav.load(\u0026std::path::Path::new(\"sample.wav\"))?;\n\n    sl.play(\u0026wav); // calls to play are non-blocking, so we put the thread to sleep\n    while sl.voice_count() \u003e 0 {\n        std::thread::sleep(std::time::Duration::from_millis(100));\n    }\n\n    wav.load(\u0026std::path::Path::new(\"Recording.mp3\"))?;\n    \n    sl.play(\u0026wav);\n    while sl.voice_count() \u003e 0 {\n        std::thread::sleep(std::time::Duration::from_millis(100));\n    }\n\n    Ok(())\n}\n```\n\nTo play speech:\n```rust,no_run\nuse soloud::*;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let mut sl = Soloud::default()?;\n\n    let mut speech = audio::Speech::default();\n\n    speech.set_text(\"Hello World\")?;\n\n    sl.play(\u0026speech);\n    while sl.active_voice_count() \u003e 0 {\n        std::thread::sleep(std::time::Duration::from_millis(100));\n    }\n\n    speech.set_text(\"1 2 3\")?;\n\n    sl.play(\u0026speech);\n    while sl.active_voice_count() \u003e 0 {\n        std::thread::sleep(std::time::Duration::from_millis(100));\n    }\n\n    speech.set_text(\"Can you hear me?\")?;\n\n    sl.play(\u0026speech);\n    while sl.active_voice_count() \u003e 0 {\n        std::thread::sleep(std::time::Duration::from_millis(100));\n    }\n    \n    Ok(())\n}\n```\n\nTo add a filter:\n```rust,no_run\nuse soloud::*;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let mut sl = Soloud::default()?;\n\n    let mut wav = audio::Wav::default();\n    let mut filt = filter::EchoFilter::default();\n    filt.set_params(0.2)?; // sets the delay\n\n    wav.load(\u0026std::path::Path::new(\"sample.wav\"))?;\n    wav.set_filter(0, Some(\u0026filt));\n\n    sl.play(\u0026wav);\n    while sl.voice_count() \u003e 0 {\n        std::thread::sleep(std::time::Duration::from_millis(100));\n    }\n\n    Ok(())\n}\n```\n\nThe examples can be found in the soloud/examples directory. They can be run using:\n```bash\ncargo run --example simple\ncargo run --example speech\ncargo run --example filter\ncargo run --example load_mem\n```\nYou will need to have valid \"sample.wav\" and \"Recording.mp3\" audio files in the project root. Or you can change the paths to point to any supported audio file.\n\nThere is also a demo gui application (using fltk) [here](https://github.com/fltk-rs/demos/tree/master/musicplayer).\n\n## Dependencies\nA Rust compiler, C++ compiler, Cargo, CMake and git (all these need to be in your PATH). Ninja is recommended, but not required, and will be used if found. This crate uses the miniaudio backend by default which assumes default sound drivers are functional.\n\n## Backends\nThe default backend is miniaudio, however Soloud supports several backends to varying degrees. To enable support of a certain backend, alsa for example:\n```toml\n[dependencies]\nsoloud = { version = \"1\", default-features = false, features = [\"alsa\"] }\n```\nThis also assumes that those libraries headers are in your include path where CMake can find them, otherwise you can set it via the command line (posix):\n```bash\nexport CXXFLAGS=\"-I /path/to/include\"\n```\nor for Windows:\n```bash\nset CXXFLAGS=\"-I C:\\\\path\\\\to\\\\include\"\n```\nThe same can be done for CFLAGS if needed.\n\n### Supported backends:\n- miniaudio\n- oss\n- alsa\n- sdl2\n- sdl2-static\n- portaudio\n- openal\n- xaudio2\n- winmm\n- wasapi\n- opensles\n- coreaudio\n- jack\n\n### Android support\nThe ANDROID_SDK_ROOT and ANDROID_NDK_ROOT need to be set.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMoAlyousef%2Fsoloud-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMoAlyousef%2Fsoloud-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMoAlyousef%2Fsoloud-rs/lists"}