diff --git a/Cargo.toml b/Cargo.toml index d6a5767..27dfe8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rodio" -version = "0.5.0" +version = "0.5.1" authors = ["Pierre Krieger "] license = "Apache-2.0" description = "Audio playback library" diff --git a/src/sink.rs b/src/sink.rs index 68ba49f..3596542 100644 --- a/src/sink.rs +++ b/src/sink.rs @@ -116,6 +116,12 @@ impl Sink { self.pause.load(Ordering::SeqCst) } + /// Stops the sink by emptying the queue. + #[inline] + pub fn stop(&self) { + self.stopped.store(true, Ordering::SeqCst); + } + /// Destroys the sink without stopping the sounds that are still playing. #[inline] pub fn detach(mut self) {