[−][src]Struct ears::ReverbEffect
Create and configure reverb effects.
A Sound can optionally be connected to a ReverbEffect, which can modify how the user hears the Sound (through reverb, echo, frequency shift, etc)
This can be used to model the environment that the listener is in, for example a cave.
Internally it creates an OpenAL Effect Object with an Auxiliary Effect Slot Object pair.
Note: the effects API may change as it's implemented fully, but I'll try not to make the changes too drastic.
Examples
extern crate ears; use ears::{ReverbEffect, ReverbPreset, Sound, AudioController}; fn main() -> () { // Create an effect (in this case, using a preset) let effect = ReverbEffect::preset(ReverbPreset::Cave.properties()).ok(); // Create a Sound with the path of the sound file. let mut sound = Sound::new("path/to/my/sound.ogg").unwrap(); // Connect the sound to the effect sound.connect(&effect); // Play it sound.play(); // Wait until the sound stopped playing while sound.is_playing() {} // If you want to disconnect an Effect, just pass None sound.connect(&None); }
Methods
impl ReverbEffect
[src]
pub fn new() -> Result<ReverbEffect, String>
[src]
pub fn preset(
reverb_properties: ReverbProperties
) -> Result<ReverbEffect, String>
[src]
reverb_properties: ReverbProperties
) -> Result<ReverbEffect, String>
pub fn slot(&self) -> u32
[src]
Trait Implementations
impl Drop for ReverbEffect
[src]
Auto Trait Implementations
impl Send for ReverbEffect
impl Sync for ReverbEffect
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,