Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhasse/ears
Easy Api in Rust to play Sounds
https://github.com/jhasse/ears
audio music ogg openal rust sound
Last synced: 7 days ago
JSON representation
Easy Api in Rust to play Sounds
- Host: GitHub
- URL: https://github.com/jhasse/ears
- Owner: jhasse
- License: mit
- Fork: true (jeremyletang/ears)
- Created: 2013-12-16T10:36:56.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2020-04-13T17:23:32.000Z (over 4 years ago)
- Last Synced: 2024-10-02T17:08:57.598Z (about 1 month ago)
- Topics: audio, music, ogg, openal, rust, sound
- Language: Rust
- Homepage: https://docs.rs/ears/0.7.0/ears/
- Size: 2.99 MB
- Stars: 90
- Watchers: 5
- Forks: 10
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-cn - jhasse/ears - ci.org/jhasse/ears.svg?branch=master">](https://travis-ci.org/jhasse/ears) (Libraries / Audio)
- awesome-rust - jhasse/ears - ci.org/jhasse/ears.svg?branch=master">](https://travis-ci.org/jhasse/ears) (Libraries / Audio)
- awesome-rust - jhasse/ears
- awesome-rust-cn - jhasse/ears
- awesome-rust-zh - jhasse/ears - 一个简单的库,可以在 OpenAL 和 libsndfile 之上,播放声音和音乐[<img src="https://api.travis-ci.org/jhasse/ears.svg?branch=master">](https://travis-ci.org/jhasse/ears) (库 / 音频)
- awesome-rust - jhasse/ears - A simple library to play Sounds and Musics, on top of OpenAL and libsndfile (Libraries / Audio and Music)
- awesome-rust - jhasse/ears - ci.org/jhasse/ears.svg?branch=master">](https://travis-ci.org/jhasse/ears) (库 Libraries / 音频 Audio)
- awesome-rust-zh-cn - jhasse/ears - ci.org/jhasse/ears.svg?branch=master">](https://travis-ci.org/jhasse/ears) (音频(Audio) / 天文(Astronomy))
- fucking-awesome-rust - jhasse/ears - A simple library to play Sounds and Musics, on top of OpenAL and libsndfile (Libraries / Audio and Music)
- fucking-awesome-rust - jhasse/ears - A simple library to play Sounds and Musics, on top of OpenAL and libsndfile (Libraries / Audio and Music)
README
# ears [![Build Status](https://travis-ci.org/jhasse/ears.svg?branch=master)](https://travis-ci.org/jhasse/ears) [![Build status](https://ci.appveyor.com/api/projects/status/7s7wo0m97x70f3w6?svg=true)](https://ci.appveyor.com/project/jhasse/ears) [![](http://meritbadge.herokuapp.com/ears)](https://crates.io/crates/ears)
__ears__ is a simple library to play sounds and music in [Rust](https://www.rust-lang.org).
* Provides an access to the OpenAL spatialization functionality in a simple way.
* Accepts a lot of audio formats, thanks to libsndfile.## Building
You need to install OpenAL and libsndfile on your system:
### Linux
Fedora:
```
sudo dnf install openal-soft-devel libsndfile-devel
```Debian or Ubuntu:
```
sudo apt install libopenal-dev libsndfile1-dev
```### Mac
```
brew install openal-soft libsndfile
```### Windows
Install [MSYS2](http://www.msys2.org/) according to the instructions. Be sure to
use the default installation folder (i.e. `C:\msys32` or `C:\msys64`), otherwise
compiling won't work. Then, run the following in the MSYS2 shell:```
pacman -S mingw-w64-x86_64-libsndfile mingw-w64-x86_64-openal
```## Examples
```
cargo run --example basic
cargo run --example many_sounds
cargo run --example music
cargo run --example record
cargo run --example simple_player
```## Functionality
__ears__ provides two ways to play audio files:
* The Sound class, which represents light sounds who can share a buffer of samples with another
Sound.
* The Music class, which represents bigger sound and can't share sample buffers.