pub struct MixerDeviceSink { /* private fields */ }Expand description
cpal::Stream container. Use mixer() method to control output.
When dropped playback will end, and the associated
OS-Sink will be disposed
§Note
On drop this will print a message to stderr or emit a log msg when tracing is
enabled. Though we recommend you do not you can disable that print/log with:
MixerDeviceSink::log_on_drop(false).
If the DeviceSink is dropped because the program is panicking we do not print
or log anything.
§Example
let mut handle = DeviceSinkBuilder::open_default_sink()?;
handle.log_on_drop(false); // Not recommended during development
println!("Output config: {:?}", handle.config());
let mixer = handle.mixer();Implementations§
Source§impl MixerDeviceSink
impl MixerDeviceSink
Sourcepub fn config(&self) -> &DeviceSinkConfig
pub fn config(&self) -> &DeviceSinkConfig
Access the sink’s config.
Sourcepub fn log_on_drop(&mut self, enabled: bool)
pub fn log_on_drop(&mut self, enabled: bool)
When MixerDeviceSink is dropped a message is logged to stderr or
emitted through tracing if the tracing feature is enabled.
Trait Implementations§
Source§impl Debug for MixerDeviceSink
impl Debug for MixerDeviceSink
Auto Trait Implementations§
impl Freeze for MixerDeviceSink
impl !RefUnwindSafe for MixerDeviceSink
impl Send for MixerDeviceSink
impl Sync for MixerDeviceSink
impl Unpin for MixerDeviceSink
impl UnsafeUnpin for MixerDeviceSink
impl !UnwindSafe for MixerDeviceSink
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