pub struct AudioPlayer { /* private fields */ }Expand description
Plays AudioResources, one at a time, into every subscribed voice session.
Implementations§
Source§impl AudioPlayer
impl AudioPlayer
Sourcepub fn play(&self, resource: AudioResource)
pub fn play(&self, resource: AudioResource)
Plays resource now, ending the current one; the queue stays.
Sourcepub fn enqueue(&self, resource: AudioResource)
pub fn enqueue(&self, resource: AudioResource)
Plays resource after the current one and those queued before it.
Sourcepub fn status(&self) -> AudioPlayerStatus
pub fn status(&self) -> AudioPlayerStatus
What the player is doing.
Sourcepub fn next_event(&self, timeout: Duration) -> Option<AudioPlayerEvent>
pub fn next_event(&self, timeout: Duration) -> Option<AudioPlayerEvent>
The next event, or None when none arrives within timeout.
Sourcepub fn events(&self) -> impl Iterator<Item = AudioPlayerEvent> + Send + 'static
pub fn events(&self) -> impl Iterator<Item = AudioPlayerEvent> + Send + 'static
The events, blocking; ends when the player is dropped.
Trait Implementations§
Source§impl Debug for AudioPlayer
impl Debug for AudioPlayer
Source§impl Drop for AudioPlayer
impl Drop for AudioPlayer
Auto Trait Implementations§
impl !RefUnwindSafe for AudioPlayer
impl !UnwindSafe for AudioPlayer
impl Freeze for AudioPlayer
impl Send for AudioPlayer
impl Sync for AudioPlayer
impl Unpin for AudioPlayer
impl UnsafeUnpin for AudioPlayer
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