Crate ears [−] [src]
ears
A simple library to play sounds and music in Rust, using OpenAL and libsndfile.
Functionality
ears
provides two ways to play audio files.
Sound
, which is for short lived audio samples, like sound effects.Music
, which is for longer audio and streamed from the disk.
Example
extern crate ears; use ears::{Sound, AudioController}; fn main() { // Create a new Sound. let mut 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() {} }
Modules
listener |
Module for manage the listener in the scene. |
Structs
Music |
Play Music easily. |
RecordContext |
The context needed to initialize a new Recorder |
Recorder |
Record audio |
Sound |
Play Sounds easily. |
SoundData |
Samples extracted from a file. |
Tags |
Structure containing the tags of a sound. |
Enums
State |
The differents states in which a sound can be. |
Traits
AudioController |
The functionnality that an Audio Source should provide. |
AudioTags |
AudioTags trait implemented by all struct who can provides audio. |
Functions
init |
Initialize the internal context |
init_in |
Initialize the input device context |