SoundHandle

Struct SoundHandle 

Source
pub struct SoundHandle(/* private fields */);
Expand description

Wraps a Sound so it can be returned to the user after play.

This type can be cheaply cloned, and it will share the same data.

Implementations§

Source§

impl SoundHandle

Source

pub fn new(sound: Sound) -> Self

Make a new SoundHandle from a Sound.

Source

pub fn guard(&self) -> MutexGuard<'_, Sound>

Lock the Sound for modification. Returns a MutexGuard.

Source

pub fn loop_enabled(&self) -> bool

Delegate to the underlying Sound.

Source§

impl SoundHandle

Source

pub fn sample_rate(&self) -> u32

Delegate to the underlying Sound’s method.

Source

pub fn duration(&self) -> Duration

Delegate to the underlying Sound’s method.

Source

pub fn duration_seconds(&self) -> f64

Delegate to the underlying Sound’s method.

Source

pub fn push_frame_to_resampler(&self)

Delegate to the underlying Sound’s method.

Source

pub fn is_playing_backwards(&self) -> bool

Delegate to the underlying Sound’s method.

Source

pub fn update_position(&self)

Delegate to the underlying Sound’s method.

Source

pub fn finished(&self) -> bool

Delegate to the underlying Sound’s method.

Source

pub fn next_frame(&self, sample_rate: u32) -> Option<Frame>

Delegate to the underlying Sound’s method.

Source

pub fn reset(&self)

Delegate to the underlying Sound’s method.

Source

pub fn set_playback_rate(&self, playback_rate: PlaybackRate) -> PlaybackRate

Delegate to the underlying Sound’s method.

Source

pub fn playback_rate(&self) -> PlaybackRate

Delegate to the underlying Sound’s method.

Source

pub fn base_playback_rate(&self) -> PlaybackRate

Delegate to the underlying Sound’s method.

Source

pub fn set_volume(&self, volume: f32) -> f32

Delegate to the underlying Sound’s method.

Source

pub fn volume(&self) -> f32

Delegate to the underlying Sound’s method.

Source

pub fn base_volume(&self) -> f32

Delegate to the underlying Sound’s method.

Source

pub fn seek_to_index(&self, index: usize)

Delegate to the underlying Sound’s method.

Source

pub fn seek_to_end(&self)

Delegate to the underlying Sound’s method.

Source

pub fn seek_by(&self, seconds: f64)

Delegate to the underlying Sound’s method.

Source

pub fn seek_to(&self, seconds: f64)

Delegate to the underlying Sound’s method.

Source

pub fn reverse(&self)

Delegate to the underlying Sound’s method.

Source

pub fn add_command(&self, command: Command)

Delegate to the underlying Sound’s method.

Source

pub fn set_loop_index(&self, loop_region: RangeInclusive<usize>)

Delegate to the underlying Sound’s method.

Source

pub fn set_loop_enabled(&self, enabled: bool) -> bool

Delegate to the underlying Sound’s method.

Source

pub fn set_loop(&self, loop_region: RangeInclusive<f64>)

Delegate to the underlying Sound’s method.

Source

pub fn loop_start(&self) -> usize

Delegate to the underlying Sound’s method.

Source

pub fn loop_end(&self) -> usize

Delegate to the underlying Sound’s method.

Source

pub fn loop_start_secs(&self) -> f64

Delegate to the underlying Sound’s method.

Source

pub fn loop_end_secs(&self) -> f64

Delegate to the underlying Sound’s method.

Source

pub fn index(&self) -> usize

Delegate to the underlying Sound’s method.

Source

pub fn base_index(&self) -> usize

Delegate to the underlying Sound’s method.

Source

pub fn outputting_silence(&self) -> bool

Delegate to the underlying Sound’s method.

Source

pub fn pause(&self)

Delegate to the underlying Sound’s method.

Source

pub fn paused(&self) -> bool

Delegate to the underlying Sound’s method.

Source

pub fn resume(&self)

Delegate to the underlying Sound’s method.

Source

pub fn set_panning(&self, panning: f32) -> f32

Delegate to the underlying Sound’s method.

Source

pub fn panning(&self) -> f32

Delegate to the underlying Sound’s method.

Trait Implementations§

Source§

impl Clone for SoundHandle

Source§

fn clone(&self) -> SoundHandle

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SoundHandle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Sound> for SoundHandle

Source§

fn from(sound: Sound) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,