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
impl SoundHandle
Sourcepub fn new(sound: Sound) -> Self
pub fn new(sound: Sound) -> Self
Make a new SoundHandle from a Sound.
Sourcepub fn guard(&self) -> MutexGuard<'_, Sound>
pub fn guard(&self) -> MutexGuard<'_, Sound>
Lock the Sound for modification. Returns a MutexGuard.
Sourcepub fn loop_enabled(&self) -> bool
pub fn loop_enabled(&self) -> bool
Delegate to the underlying Sound.
Source§impl SoundHandle
impl SoundHandle
Sourcepub fn sample_rate(&self) -> u32
pub fn sample_rate(&self) -> u32
Delegate to the underlying Sound’s method.
Sourcepub fn duration_seconds(&self) -> f64
pub fn duration_seconds(&self) -> f64
Delegate to the underlying Sound’s method.
Sourcepub fn push_frame_to_resampler(&self)
pub fn push_frame_to_resampler(&self)
Delegate to the underlying Sound’s method.
Sourcepub fn is_playing_backwards(&self) -> bool
pub fn is_playing_backwards(&self) -> bool
Delegate to the underlying Sound’s method.
Sourcepub fn update_position(&self)
pub fn update_position(&self)
Delegate to the underlying Sound’s method.
Sourcepub fn next_frame(&self, sample_rate: u32) -> Option<Frame>
pub fn next_frame(&self, sample_rate: u32) -> Option<Frame>
Delegate to the underlying Sound’s method.
Sourcepub fn set_playback_rate(&self, playback_rate: PlaybackRate) -> PlaybackRate
pub fn set_playback_rate(&self, playback_rate: PlaybackRate) -> PlaybackRate
Delegate to the underlying Sound’s method.
Sourcepub fn playback_rate(&self) -> PlaybackRate
pub fn playback_rate(&self) -> PlaybackRate
Delegate to the underlying Sound’s method.
Sourcepub fn base_playback_rate(&self) -> PlaybackRate
pub fn base_playback_rate(&self) -> PlaybackRate
Delegate to the underlying Sound’s method.
Sourcepub fn set_volume(&self, volume: f32) -> f32
pub fn set_volume(&self, volume: f32) -> f32
Delegate to the underlying Sound’s method.
Sourcepub fn base_volume(&self) -> f32
pub fn base_volume(&self) -> f32
Delegate to the underlying Sound’s method.
Sourcepub fn seek_to_index(&self, index: usize)
pub fn seek_to_index(&self, index: usize)
Delegate to the underlying Sound’s method.
Sourcepub fn seek_to_end(&self)
pub fn seek_to_end(&self)
Delegate to the underlying Sound’s method.
Sourcepub fn add_command(&self, command: Command)
pub fn add_command(&self, command: Command)
Delegate to the underlying Sound’s method.
Sourcepub fn set_loop_index(&self, loop_region: RangeInclusive<usize>)
pub fn set_loop_index(&self, loop_region: RangeInclusive<usize>)
Delegate to the underlying Sound’s method.
Sourcepub fn set_loop_enabled(&self, enabled: bool) -> bool
pub fn set_loop_enabled(&self, enabled: bool) -> bool
Delegate to the underlying Sound’s method.
Sourcepub fn set_loop(&self, loop_region: RangeInclusive<f64>)
pub fn set_loop(&self, loop_region: RangeInclusive<f64>)
Delegate to the underlying Sound’s method.
Sourcepub fn loop_start(&self) -> usize
pub fn loop_start(&self) -> usize
Delegate to the underlying Sound’s method.
Sourcepub fn loop_start_secs(&self) -> f64
pub fn loop_start_secs(&self) -> f64
Delegate to the underlying Sound’s method.
Sourcepub fn loop_end_secs(&self) -> f64
pub fn loop_end_secs(&self) -> f64
Delegate to the underlying Sound’s method.
Sourcepub fn base_index(&self) -> usize
pub fn base_index(&self) -> usize
Delegate to the underlying Sound’s method.
Sourcepub fn outputting_silence(&self) -> bool
pub fn outputting_silence(&self) -> bool
Delegate to the underlying Sound’s method.
Sourcepub fn set_panning(&self, panning: f32) -> f32
pub fn set_panning(&self, panning: f32) -> f32
Delegate to the underlying Sound’s method.
Trait Implementations§
Source§impl Clone for SoundHandle
impl Clone for SoundHandle
Source§fn clone(&self) -> SoundHandle
fn clone(&self) -> SoundHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more