{"id":13535338,"url":"https://github.com/JeremyLetang/ears","last_synced_at":"2025-04-02T01:30:32.510Z","repository":{"id":11071538,"uuid":"13415430","full_name":"jeremyletang/ears","owner":"jeremyletang","description":"Easy Api in Rust to play Sounds (this repository is not maintained anymore, please see https://github.com/jhasse/ears)","archived":false,"fork":false,"pushed_at":"2018-10-21T17:03:29.000Z","size":1762,"stargazers_count":60,"open_issues_count":6,"forks_count":25,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T01:35:55.657Z","etag":null,"topics":[],"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/jeremyletang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-08T14:16:13.000Z","updated_at":"2024-08-13T09:50:10.000Z","dependencies_parsed_at":"2022-09-23T17:03:12.292Z","dependency_job_id":null,"html_url":"https://github.com/jeremyletang/ears","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyletang%2Fears","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyletang%2Fears/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyletang%2Fears/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyletang%2Fears/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeremyletang","download_url":"https://codeload.github.com/jeremyletang/ears/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246738381,"owners_count":20825775,"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":[],"created_at":"2024-08-01T08:00:54.164Z","updated_at":"2025-04-02T01:30:32.252Z","avatar_url":"https://github.com/jeremyletang.png","language":"Rust","readme":"# ears [![Build Status](https://travis-ci.org/jeremyletang/ears.png?branch=master)](https://travis-ci.org/jeremyletang/ears)\n\n\n__ears__ is a simple library to play Sounds and Musics in Rust.\n\n__ears__ is build on the top of OpenAL and libsndfile.\n\n* Provides an access to the OpenAL spatialization functionality in a simple way.\n* Accepts a lot of audio formats, thanks to libsndfile.\n\n# A simple example\n\n```Rust\nextern crate ears;\nuse ears::Sound;\n\nfn main() {\n\t// Create a new Sound.\n\tlet snd = Sound::new(\"path/to/my/sound.ogg\").unwrap();\n\n\t// Play the Sound\n\tsnd.play();\n\n\t// Wait until the end of the sound\n\twhile snd.is_playing() {}\n}\n```\n\n# Functionalities\n\n__ears__ provides two ways to play audio files.\n\n* The Sound class, which represents light sounds who can share a buffer of samples with another Sound.\n* The Music class, which is a bigger sound and who can't share sample buffer.\n\n# Use ears\n\nLike previously said, __ears__ requires OpenAL and libsndfile. You need to install these two libraries on your system.\n\n__ears__ compiles against the last Rust compiler, so if it doesn't work on your computer you may need to update your compiler.\n\n__ears__ is built using make, so just type `make` at the root of the __ears__ repository, this command\nbuilds __ears__, examples and the documentation.\n\nYou can build them separately too with the dedicated commands:\n\n```Shell\n\u003e make ears\n\u003e make examples\n\u003e make doc\n```\n\nthen import stuff from __ears__ in your project, you can import all the stuff:\n\n```Rust\n#[feature(globs)];\nextern crate ears;\n\nuse ears::*;\n```\n\nor a specific one:\n\n```Rust\nextern crate ears;\n\nuse ears::Music;\n```\n","funding_links":[],"categories":["代码"],"sub_categories":["音频"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJeremyLetang%2Fears","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJeremyLetang%2Fears","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJeremyLetang%2Fears/lists"}