summaryrefslogtreecommitdiff
path: root/src/audio/rodio.rs
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2024-06-04 20:59:56 +0200
committerYuval Adam <_@yuv.al>2024-06-04 20:59:56 +0200
commitf7fe187c464525339c58996ec86b4faea4306789 (patch)
tree63e3c7dfbbd37d1dd7da84e8c58f70e2dbab101d /src/audio/rodio.rs
parent355743d349d8f63a5d98246c0f0265812fbb2482 (diff)
Use unbounded mpsc channel
Diffstat (limited to 'src/audio/rodio.rs')
-rw-r--r--src/audio/rodio.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/audio/rodio.rs b/src/audio/rodio.rs
index 695c6cb..f5ad5cc 100644
--- a/src/audio/rodio.rs
+++ b/src/audio/rodio.rs
@@ -13,7 +13,7 @@ const AUDIO_BUFFER_SECONDS: u32 = 5;
pub struct Rodio {}
impl Rodio {
- pub async fn play(&self, url: &str, tx: mpsc::Sender<String>) {
+ pub async fn play(&self, url: &str, tx: mpsc::UnboundedSender<String>) {
let (_stream, handle) = OutputStream::try_default().unwrap();
let sink = Sink::try_new(&handle).unwrap();
@@ -57,7 +57,7 @@ impl Rodio {
}
},
))
- .unwrap(),
+ .expect("Failed to play stream, check network and try again later"),
);
let handle = tokio::task::spawn_blocking(move || {