pub struct AudioEngine { /* private fields */ }Implementations§
Source§impl AudioEngine
impl AudioEngine
pub fn new( resampling_quality: Option<ResamplingQuality>, callback: Box<dyn PlayerCallback>, ) -> Result<Arc<async_Mutex<Self>>, i32>
pub fn get_callback_context<T: Any>(&mut self) -> Option<&mut T>
pub fn get_duration(&self) -> f64
pub fn set_callback_context<T: Any>(&mut self, data: T)
Sourcepub async fn load(
audio_engine: Arc<async_Mutex<Self>>,
file: &str,
player: Weak<Player>,
) -> Result<(), i32>
pub async fn load( audio_engine: Arc<async_Mutex<Self>>, file: &str, player: Weak<Player>, ) -> Result<(), i32>
Loads files. Automatically stops previous playback if any. Requires an arc clone of the player object because it’s later passed as context to media end callback
pub fn get_progress(&self) -> Result<f64, i32>
pub fn get_volume(&self) -> f32
pub fn set_volume(&self, volume: f32)
pub fn clear(&mut self) -> Result<(), i32>
pub fn play(&mut self) -> Result<(), i32>
pub fn pause(&mut self) -> Result<(), i32>
pub fn seek(&mut self, time_s: f64) -> Result<(), i32>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AudioEngine
impl !UnwindSafe for AudioEngine
impl Freeze for AudioEngine
impl Unpin for AudioEngine
impl UnsafeUnpin for AudioEngine
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