Skip to content

Commit edb9b27

Browse files
author
dvdsk
committed
fix example dropping sink immediatly halting playback
1 parent 50d35f6 commit edb9b27

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
//!
4949
//! // Load a sound from a file, using a path relative to Cargo.toml
5050
//! let file = BufReader::new(File::open("examples/music.ogg").unwrap());
51-
//! rodio::play(&stream_handle.mixer(), file).unwrap();
51+
//! // Note that the playback stops when the sink is dropped
52+
//! let sink = rodio::play(&stream_handle.mixer(), file).unwrap();
5253
//!
5354
//! // The sound plays in a separate audio thread,
5455
//! // so we need to keep the main thread alive while it's playing.

0 commit comments

Comments
 (0)