{"id":13412178,"url":"https://github.com/RustAudio/rodio","last_synced_at":"2025-03-14T18:30:35.981Z","repository":{"id":35243278,"uuid":"39502833","full_name":"RustAudio/rodio","owner":"RustAudio","description":"Rust audio playback library","archived":false,"fork":false,"pushed_at":"2024-07-11T16:01:42.000Z","size":17376,"stargazers_count":1671,"open_issues_count":134,"forks_count":216,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-07-12T04:49:59.656Z","etag":null,"topics":["audio","audio-playback-library","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RustAudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2015-07-22T11:38:27.000Z","updated_at":"2024-07-12T04:50:12.149Z","dependencies_parsed_at":"2023-02-16T11:31:04.269Z","dependency_job_id":"9f5747e9-00d8-4aaf-8571-2ebb3bb58c8f","html_url":"https://github.com/RustAudio/rodio","commit_stats":{"total_commits":404,"total_committers":80,"mean_commits":5.05,"dds":0.5297029702970297,"last_synced_commit":"5e034a290838f608fbd026dde2bcd80a6747b787"},"previous_names":["tomaka/rodio"],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustAudio%2Frodio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustAudio%2Frodio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustAudio%2Frodio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustAudio%2Frodio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RustAudio","download_url":"https://codeload.github.com/RustAudio/rodio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243112146,"owners_count":20238185,"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","audio-playback-library","rust"],"created_at":"2024-07-30T20:01:21.829Z","updated_at":"2025-03-14T18:30:35.977Z","avatar_url":"https://github.com/RustAudio.png","language":"Rust","readme":"# Audio playback library\n\n[![Crates.io Version](https://img.shields.io/crates/v/rodio.svg)](https://crates.io/crates/rodio)\n[![Crates.io Downloads](https://img.shields.io/crates/d/rodio.svg)](https://crates.io/crates/rodio)\n[![Build Status](https://github.com/RustAudio/rodio/workflows/CI/badge.svg)](https://github.com/RustAudio/rodio/actions)\n\nRust playback library.\n\nPlayback is handled by [cpal](https://github.com/RustAudio/cpal). Format decoding can be handled either by [Symphonia](https://github.com/pdeljanov/Symphonia), or by format-specific decoders:\n\n - MP3 by [minimp3](https://github.com/lieff/minimp3) (but defaults to [Symphonia](https://github.com/pdeljanov/Symphonia)).\n - WAV by [hound](https://github.com/ruud-v-a/hound).\n - Vorbis by [lewton](https://github.com/est31/lewton).\n - FLAC by [claxon](https://github.com/ruuda/claxon).\n - MP4 and AAC (both disabled by default) are handled only by [Symphonia](https://github.com/pdeljanov/Symphonia).\n\nSee [the docs](https://docs.rs/rodio/latest/rodio/#alternative-decoder-backends) for more details on backends.\n\n# [Documentation](http://docs.rs/rodio)\n\n[The documentation](http://docs.rs/rodio) contains an introduction to the library.\n\n# [Examples](https://github.com/RustAudio/rodio/tree/f1eaaa4a6346933fc8a58d5fd1ace170946b3a94/examples)\n\nWe are currently making large improvements to rodio. This does mean the updated examples do not work with the current crates.io release. You will have to look at the examples from commit `f1eaaa4a`. They are available [on github](https://github.com/RustAudio/rodio/tree/f1eaaa4a6346933fc8a58d5fd1ace170946b3a94/examples).\n\n## Requirements\n\nRodio playback works in environments supported by [cpal](https://github.com/RustAudio/cpal) library.\n\nThe CPU of the target system should have hardware support for 32-bit floating point (`f32`), and atomic operations that are at least 32 bit wide. Without these the CPU may not be fast enough to keep up with real-time.\n\n## Dependencies (Linux only)\n\nRodio uses `cpal` library to send audio to the OS for playback. ALSA development files are needed to build `cpal` on Linux. These are provided as part of the `libasound2-dev` package on Debian and Ubuntu distributions and `alsa-lib-devel` on Fedora.\n\n### Minimal build\n\nIt is possible to build `rodio` without support for audio playback. In this configuration `cpal` dependency and its requirements are excluded. This configuration may be useful, for example, for decoding and processing audio in environments when the audio output is not available (e.g. in case of Linux, when ALSA is not available). See `into_file` example that works with this build.\n\nIn order to use `rodio` in this configuration disable default features and add the necessary ones. In this case the `Cargo.toml` dependency would look like:\n```toml\n[dependencies]\nrodio = { version = \"0.20.1\", default-features = false, features = [\"symphonia-all\"] }\n```\n### Cross compling aarch64/arm\n\nThrough cpal rodio depends on the alsa library (libasound \u0026 libasound-dev), this can make crosscompiling hard. Cpal has some guides on crosscompling in their Readme (https://github.com/RustAudio/cpal). They are missing instructions on aarch64 (arm linux) so we have some here:\n\n#### aarch64/arm on Debian like (Ubuntu/pop)\n- Install crossbuild-essential-arm64: `sudo apt-get install crossbuild-essential-arm64 clang`\n- Add the aarch64 target for rust: `rustup target add aarch64-unknown-linux-gnu`\n- Add the architecture arm64 to apt using: `sudo dpkg --add-architecture arm64`\n- Install the [multi-arch](https://wiki.debian.org/Multiarch/HOWTO) version of libasound2-dev for arm64 using: `sudo apt install libasound2-dev:arm64` \n- Build with the pkg config sysroot set to /usr/aarch64-linux-gnu and aarch64-linux-gnu as linker: `PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu RUSTFLAGS=\"-C linker=aarch64-linux-gnu-gcc\" cargo build --target aarch64-unknown-linux-gnu`\n\nThis will work for other Linux targets too if you change the architecture in the\ncommand and if there are multi-arch packages available.\n\nYou might want to look at [cross](https://github.com/cross-rs/cross) if you are\nrunning on a non debian system or want to make this more repeatable.\n\n# Contributing\n\nFor information on how to contribute to this project, please see our [Contributing Guide](CONTRIBUTING.md).\n\n## License\n[License]: #license\n\nLicensed under either of\n\n* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0), or\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### License of your contributions\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","funding_links":[],"categories":["Rust","Libraries","库 Libraries","库"],"sub_categories":["Audio","Audio and Music","音频和音乐 Audio and Music","音频"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRustAudio%2Frodio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRustAudio%2Frodio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRustAudio%2Frodio/lists"}