pub struct Sound { /* private fields */ }
Expand description
Sound
Implementations§
Source§impl Sound
impl Sound
Sourcepub fn frame_count(&self) -> u32
pub fn frame_count(&self) -> u32
Total number of frames (considering channels)
Sourcepub fn play(&self, _device: &mut AudioDevice)
pub fn play(&self, _device: &mut AudioDevice)
Play a sound
Sourcepub fn stop(&self, _device: &mut AudioDevice)
pub fn stop(&self, _device: &mut AudioDevice)
Stop playing a sound
Sourcepub fn pause(&self, _device: &mut AudioDevice)
pub fn pause(&self, _device: &mut AudioDevice)
Pause a sound
Sourcepub fn resume(&self, _device: &mut AudioDevice)
pub fn resume(&self, _device: &mut AudioDevice)
Resume a paused sound
Sourcepub fn is_playing(&self, _device: &mut AudioDevice) -> bool
pub fn is_playing(&self, _device: &mut AudioDevice) -> bool
Check if a sound is currently playing
Sourcepub fn set_volume(&self, volume: f32, _device: &mut AudioDevice)
pub fn set_volume(&self, volume: f32, _device: &mut AudioDevice)
Set volume for a sound (1.0 is max level)
Sourcepub fn set_pitch(&self, pitch: f32, _device: &mut AudioDevice)
pub fn set_pitch(&self, pitch: f32, _device: &mut AudioDevice)
Set pitch for a sound (1.0 is base level)
Sourcepub fn set_pan(&self, pan: f32, _device: &mut AudioDevice)
pub fn set_pan(&self, pan: f32, _device: &mut AudioDevice)
Set pan for a sound (0.5 is center)
Sourcepub fn as_raw(&self) -> &Sound
pub fn as_raw(&self) -> &Sound
Get the ‘raw’ ffi type Take caution when cloning so it doesn’t outlive the original
Sourcepub fn as_raw_mut(&mut self) -> &mut Sound
pub fn as_raw_mut(&mut self) -> &mut Sound
Get the ‘raw’ ffi type Take caution when cloning so it doesn’t outlive the original
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sound
impl RefUnwindSafe for Sound
impl !Send for Sound
impl !Sync for Sound
impl Unpin for Sound
impl UnwindSafe for Sound
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