[][src]Struct ears::ReverbEffect

pub struct ReverbEffect { /* fields omitted */ }

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]

pub fn slot(&self) -> u32[src]

Trait Implementations

impl Drop for ReverbEffect[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]