pub struct OutputStream { /* private fields */ }
Expand description
cpal::Stream
container. Use mixer()
method to control output.
When dropped playback will end, and the associated
output stream 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:
OutputStream::log_on_drop(false)
.
If the OutputStream
is dropped because the program is panicking we do not print
or log anything.
§Example
let mut stream_handle = OutputStreamBuilder::open_default_stream()?;
stream_handle.log_on_drop(false); // Not recommended during development
println!("Output config: {:?}", stream_handle.config());
let mixer = stream_handle.mixer();
Implementations§
Source§impl OutputStream
impl OutputStream
Sourcepub fn config(&self) -> &OutputStreamConfig
pub fn config(&self) -> &OutputStreamConfig
Access the output stream’s config.
Sourcepub fn log_on_drop(&mut self, enabled: bool)
pub fn log_on_drop(&mut self, enabled: bool)
When OutputStream
is dropped a message is logged to stderr or
emitted through tracing if the tracing feature is enabled.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OutputStream
impl !RefUnwindSafe for OutputStream
impl Send for OutputStream
impl Sync for OutputStream
impl Unpin for OutputStream
impl !UnwindSafe for OutputStream
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