mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 00:01:34 +11:00
try_recv to remove unwrap
This commit is contained in:
parent
afddd77ce8
commit
45f8a52eb5
|
@ -42,7 +42,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||
&config.into(),
|
||||
move |data: &mut [f32], _| {
|
||||
for val in data.iter_mut() {
|
||||
*val = rx.recv().unwrap();
|
||||
*val = rx.try_recv().unwrap_or(0.0);
|
||||
}
|
||||
},
|
||||
|err| eprintln!("Error on audio stream {err}"),
|
||||
|
|
Loading…
Reference in a new issue