Struct ez_audio::AudioHandle[][src]

pub struct AudioHandle<T> { /* fields omitted */ }

A handle that can be used to control audio playback.

Implementations

impl<T> AudioHandle<T>[src]

pub fn play(&self)[src]

Starts playing audio.

pub fn stop(&self)[src]

Pauses playback.

pub fn reset(&self)[src]

Resets to start of audio clip.

pub fn path(&self) -> &Path[src]

Returns the path used to create the handle.

pub fn name(&self) -> &str[src]

Returns name of file used to create the handle.

pub fn set_volume(&self, volume: f32)[src]

Sets volume.

pub fn volume(&self) -> f32[src]

Returns volume.

pub fn is_playing(&self) -> bool[src]

Checks if the handle is currently playing

pub fn is_paused(&self) -> bool[src]

Checks if the handle is currently paused

pub fn duration(&self) -> Duration[src]

Gets duration of audio handle

pub fn set_output_device(&self, device: &Device)[src]

Sets playback device

pub fn set_user_data(&mut self, data: T)[src]

Sets userdata.

pub fn modify_user_data<I: FnMut(&mut T)>(&self, closure: I)[src]

Modifes userdata using closure.

Trait Implementations

impl<T> Drop for AudioHandle<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for AudioHandle<T>

impl<T> Send for AudioHandle<T> where
    T: Send + Sync

impl<T> Sync for AudioHandle<T> where
    T: Send + Sync

impl<T> Unpin for AudioHandle<T>

impl<T> UnwindSafe for AudioHandle<T>

Blanket Implementations

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

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

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

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.