pub struct AudioOutput { /* private fields */ }Expand description
Audio output stream (playback)
Implementations§
Source§impl AudioOutput
impl AudioOutput
Sourcepub fn new(audio_config: AudioConfig) -> IoResult<Self>
pub fn new(audio_config: AudioConfig) -> IoResult<Self>
Create a new audio output
Sourcepub fn write(&mut self, samples: &Array1<f32>) -> IoResult<()>
pub fn write(&mut self, samples: &Array1<f32>) -> IoResult<()>
Write samples to playback buffer
Sourcepub fn write_channels(&mut self, samples: &Array2<f32>) -> IoResult<()>
pub fn write_channels(&mut self, samples: &Array2<f32>) -> IoResult<()>
Write multi-channel samples (interleaved)
Sourcepub fn buffer_level(&self) -> usize
pub fn buffer_level(&self) -> usize
Get buffer level (number of samples queued)
Sourcepub fn underrun_count(&self) -> usize
pub fn underrun_count(&self) -> usize
Get underrun count
Sourcepub fn clear_buffer(&mut self) -> IoResult<()>
pub fn clear_buffer(&mut self) -> IoResult<()>
Clear buffer
Sourcepub fn list_devices_with_backend(backend: AudioBackend) -> IoResult<Vec<String>>
pub fn list_devices_with_backend(backend: AudioBackend) -> IoResult<Vec<String>>
Get available output devices for a specific backend
Sourcepub fn list_devices() -> IoResult<Vec<String>>
pub fn list_devices() -> IoResult<Vec<String>>
Get available output devices (using default backend)
Auto Trait Implementations§
impl Freeze for AudioOutput
impl !RefUnwindSafe for AudioOutput
impl Send for AudioOutput
impl Sync for AudioOutput
impl Unpin for AudioOutput
impl !UnwindSafe for AudioOutput
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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more