pub struct AudioOut { /* private fields */ }Expand description
Active audio output stream wrapper.
Implementations§
Source§impl AudioOut
impl AudioOut
Sourcepub fn new(config: &AudioConfig) -> Result<Self>
pub fn new(config: &AudioConfig) -> Result<Self>
Open the default output device and start playback.
Sourcepub fn new_with_device(
config: &AudioConfig,
device_name: Option<&str>,
) -> Result<Self>
pub fn new_with_device( config: &AudioConfig, device_name: Option<&str>, ) -> Result<Self>
Open a specific output device by name (or default if None).
Sourcepub fn push_frame(&self, frame: &[i16])
pub fn push_frame(&self, frame: &[i16])
Push a PCM frame into the playback queue.
Sourcepub fn frame_samples(&self) -> usize
pub fn frame_samples(&self) -> usize
Number of samples per frame.
Sourcepub fn queued_samples(&self) -> usize
pub fn queued_samples(&self) -> usize
Samples currently queued for playback.
Auto Trait Implementations§
impl Freeze for AudioOut
impl !RefUnwindSafe for AudioOut
impl !Send for AudioOut
impl !Sync for AudioOut
impl Unpin for AudioOut
impl !UnwindSafe for AudioOut
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