Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ impl MixerDeviceSink {
pub fn mixer(&self) -> &Mixer {
&self.mixer
}
/// pause underlaying audio stream reducing cpu usage
///
/// will silenty fail to play audio until play() is called
///
/// This is an experimental API it is likely to removed once a better solution is found without notice or a change log entry
#[cfg(feature = "experimental")]
pub fn pause(&self) {
let _ = self._stream.pause();
}
/// resume underlaying audio stream
///
/// This is an experimental API it is likely to removed once a better solution is found without notice or a change log entry
#[cfg(feature = "experimental")]
pub fn play(&self) {
let _ = self._stream.play();
}

/// Access the sink's config.
pub fn config(&self) -> &DeviceSinkConfig {
Expand Down