pub struct AudioPlayer { /* private fields */ }Implementations§
Source§impl AudioPlayer
impl AudioPlayer
pub fn new() -> Self
Sourcepub fn enqueue_audio(
&self,
data: &[u8],
pts_us: i64,
sample_rate: i32,
channels: i32,
format: AudioFormat,
) -> Result<()>
pub fn enqueue_audio( &self, data: &[u8], pts_us: i64, sample_rate: i32, channels: i32, format: AudioFormat, ) -> Result<()>
PCM データをキューに追加する。
pub fn is_playing(&self) -> bool
pub fn volume(&self) -> f32
pub fn set_volume(&self, volume: f32) -> Result<()>
Sourcepub fn audio_clock_us(&self) -> i64
pub fn audio_clock_us(&self) -> i64
現在の音声再生位置をマイクロ秒で返す。
Sourcepub fn is_started(&self) -> bool
pub fn is_started(&self) -> bool
音声再生が開始されたかを返す。
Sourcepub fn audio_queue_ms(&self) -> f64
pub fn audio_queue_ms(&self) -> f64
音声キューのバッファ量をミリ秒で返す。
pub fn stats(&self) -> AudioPlayerStats
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AudioPlayer
impl RefUnwindSafe for AudioPlayer
impl Send for AudioPlayer
impl Sync for AudioPlayer
impl Unpin for AudioPlayer
impl UnsafeUnpin for AudioPlayer
impl UnwindSafe 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