在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:jeremyletang/ears开源软件地址:https://github.com/jeremyletang/ears开源编程语言:Rust 98.8%开源软件介绍:earsears is a simple library to play Sounds and Musics in Rust. ears is build on the top of OpenAL and libsndfile.
A simple exampleextern crate ears;
use ears::Sound;
fn main() {
// Create a new Sound.
let snd = Sound::new("path/to/my/sound.ogg").unwrap();
// Play the Sound
snd.play();
// Wait until the end of the sound
while snd.is_playing() {}
} Functionalitiesears provides two ways to play audio files.
Use earsLike previously said, ears requires OpenAL and libsndfile. You need to install these two libraries on your system. ears compiles against the last Rust compiler, so if it doesn't work on your computer you may need to update your compiler. ears is built using make, so just type You can build them separately too with the dedicated commands: > make ears
> make examples
> make doc then import stuff from ears in your project, you can import all the stuff: #[feature(globs)];
extern crate ears;
use ears::*; or a specific one: extern crate ears;
use ears::Music; |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论