oa::AudioPlayer

Incremental WAV, FLAC, or MP3 playback through the default output device.

StRust public API

Declaration

pub struct AudioPlayer { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn play(&mut self) -> Result<()>
pub fn pause(&self)
pub fn seek(&mut self, timestamp_us: u64) -> Result<()>
pub fn set_loop(&self, enabled: bool)
pub fn set_muted(&self, muted: bool) -> Result<()>
pub fn close(&mut self) -> Result<()>
pub const fn is_open(&self) -> bool
pub fn is_playing(&self) -> bool
pub fn is_eos(&self) -> bool
pub fn is_muted(&self) -> bool
pub const fn sample_rate(&self) -> u32
pub const fn channel_count(&self) -> u32
pub const fn duration_us(&self) -> u64
pub fn position_us(&self) -> u64
pub fn underrun_frame_count(&self) -> u64
pub fn device_error_count(&self) -> u64
fn drop(&mut self)

Associated Functions

pub fn open(engine: &Engine, config: AudioPlayerConfig) -> Result<Self>
pub fn open_uri(engine: &Engine, uri: impl AsRef<Path>) -> Result<Self>

Public Method Documentation

pub fn play(&mut self) -> Result<()>
No public source comment is attached to this declaration.
pub fn pause( &self )
No public source comment is attached to this declaration.
pub fn seek(&mut self, timestamp_us: u64) -> Result<()>
No public source comment is attached to this declaration.
pub fn set_loop( &self, enabled: bool )
Open the source and default output device with decoding initially paused.
pub fn set_muted(&self, muted: bool) -> Result<()>
Open the source and default output device with decoding initially paused.
pub fn close(&mut self) -> Result<()>
No public source comment is attached to this declaration.
pub const fn is_open( &self ) -> bool
Open the source and default output device with decoding initially paused.
pub fn is_playing( &self ) -> bool
Open the source and default output device with decoding initially paused.
pub fn is_eos( &self ) -> bool
Open the source and default output device with decoding initially paused.
pub fn is_muted( &self ) -> bool
Open the source and default output device with decoding initially paused.
pub const fn sample_rate( &self ) -> u32
Open the source and default output device with decoding initially paused.
pub const fn channel_count( &self ) -> u32
Open the source and default output device with decoding initially paused.
pub const fn duration_us( &self ) -> u64
Open the source and default output device with decoding initially paused.
pub fn position_us( &self ) -> u64
Open the source and default output device with decoding initially paused.
pub fn underrun_frame_count( &self ) -> u64
Open the source and default output device with decoding initially paused.
pub fn device_error_count( &self ) -> u64
Open the source and default output device with decoding initially paused.
fn drop( &mut self )
No public source comment is attached to this declaration.
pub fn open( engine: &Engine, config: AudioPlayerConfig ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn open_uri( engine: &Engine, uri: impl AsRef<Path> ) -> Result<Self>
No public source comment is attached to this declaration.