Struct crankstart::sound::Sound
source · pub struct Sound { /* private fields */ }
Expand description
Sound
is the main interface to the Playdate audio subsystems.
Implementations§
source§impl Sound
impl Sound
sourcepub fn get() -> Self
pub fn get() -> Self
Gets a handle to the Sound system. This is the primary entry point for users.
sourcepub fn get_file_player(&self) -> Result<FilePlayer>
pub fn get_file_player(&self) -> Result<FilePlayer>
Get a FilePlayer
that can be used to stream audio from disk, e.g. for music.
sourcepub fn get_sample_player(&self) -> Result<SamplePlayer>
pub fn get_sample_player(&self) -> Result<SamplePlayer>
Get a SamplePlayer
that can be used to play sound effects.
sourcepub fn load_audio_sample(&self, sample_path: &str) -> Result<AudioSample>
pub fn load_audio_sample(&self, sample_path: &str) -> Result<AudioSample>
Loads an AudioSample
sound effect. Assign it to a SamplePlayer
with
SamplePlayer.set_sample
.
sourcepub fn get_current_time(&self) -> Result<c_uint>
pub fn get_current_time(&self) -> Result<c_uint>
Returns the sound engine’s current time, in frames, 44.1k per second.
Trait Implementations§
Auto Trait Implementations§
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