[−][src]Trait ggez::audio::SoundSource
The source for a sound.
Required methods
fn play_later(&self) -> GameResult
Plays the SpatialSource
; waits until done if the sound is currently playing
fn play_detached(&mut self) -> GameResult
Play source "in the background"; cannot be stopped
fn set_repeat(&mut self, repeat: bool)
Sets the source to repeat playback infinitely on next play()
fn set_fade_in(&mut self, dur: Duration)
Sets the fade-in time of the source
fn set_pitch(&mut self, ratio: f32)
Sets the speed ratio (by adjusting the playback speed)
fn repeat(&self) -> bool
Gets whether or not the source is set to repeat.
fn pause(&self)
Pauses playback
fn resume(&self)
Resumes playback
fn stop(&mut self)
Stops playback
fn stopped(&self) -> bool
Returns whether or not the source is stopped -- that is, has no more data to play.
fn volume(&self) -> f32
Gets the current volume.
fn set_volume(&mut self, value: f32)
Sets the current volume.
fn paused(&self) -> bool
Get whether or not the source is paused.
fn playing(&self) -> bool
Get whether or not the source is playing (ie, not paused and not stopped).
fn elapsed(&self) -> Duration
Get the time the source has been playing since the last call to play()
.
Time measurement is based on audio samples consumed, so it may drift from the system
fn set_query_interval(&mut self, t: Duration)
Set the update interval of the internal sample counter.
This parameter determines the precision of the time measured by elapsed()
.
Provided methods
fn play(&mut self) -> GameResult
Plays the audio source; restarts the sound if currently playing
Implementors
impl SoundSource for Source
[src]
fn play_later(&self) -> GameResult
[src]
fn play_detached(&mut self) -> GameResult
[src]
fn set_repeat(&mut self, repeat: bool)
[src]
fn set_fade_in(&mut self, dur: Duration)
[src]
fn set_pitch(&mut self, ratio: f32)
[src]
fn repeat(&self) -> bool
[src]
fn pause(&self)
[src]
fn resume(&self)
[src]
fn stop(&mut self)
[src]
fn stopped(&self) -> bool
[src]
fn volume(&self) -> f32
[src]
fn set_volume(&mut self, value: f32)
[src]
fn paused(&self) -> bool
[src]
fn playing(&self) -> bool
[src]
fn elapsed(&self) -> Duration
[src]
fn set_query_interval(&mut self, t: Duration)
[src]
fn play(&mut self) -> GameResult
[src]
impl SoundSource for SpatialSource
[src]
fn play_later(&self) -> GameResult
[src]
Plays the SpatialSource
; waits until done if the sound is currently playing.