pub struct Audio {}Expand description
A interface of an audio player.
Implementations§
Source§impl Audio
impl Audio
Sourcepub fn stop(handle: i32)
pub fn stop(handle: i32)
Stops a sound effect that is currently playing.
§Arguments
handler- The handler for the audio that is returned by theplayfunction.
Sourcepub fn play_stream(filename: &str, looping: bool, cross_fade_time: f32)
pub fn play_stream(filename: &str, looping: bool, cross_fade_time: f32)
Plays a streaming audio file.
§Arguments
filename- The path to the streaming audio file (can be OGG, WAV, MP3, or FLAC).loop- Whether to loop the streaming audio.crossFadeTime- The time (in seconds) to crossfade between the previous and new streaming audio.
Sourcepub fn stop_stream(fade_time: f32)
pub fn stop_stream(fade_time: f32)
Stops a streaming audio file that is currently playing.
§Arguments
fade_time- The time (in seconds) to fade out the streaming audio.
Auto Trait Implementations§
impl Freeze for Audio
impl RefUnwindSafe for Audio
impl Send for Audio
impl Sync for Audio
impl Unpin for Audio
impl UnwindSafe for Audio
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more