diff --git a/src/main.rs b/src/main.rs index 3929704..6392fd3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -121,7 +121,7 @@ fn new_listener() -> Listener { impl Listener { fn listen(self, mut cb: impl FnMut(Vec)) { - let (send, recv) = std::sync::mpsc::channel(); + let (send, recv) = std::sync::mpsc::sync_channel(5_000_000); thread::spawn(move || { self._listen(send); }); loop { match recv.recv() { @@ -131,7 +131,7 @@ impl Listener { } } - fn _listen(self, ch: std::sync::mpsc::Sender>) { + fn _listen(self, ch: std::sync::mpsc::SyncSender>) { let host = cpal::default_host(); let device = host.default_input_device().unwrap(); let cfg = device.supported_input_configs()