diff --git a/lunabotics/lunabot/src/audio.rs b/lunabotics/lunabot/src/audio.rs index a125794..2ee2530 100644 --- a/lunabotics/lunabot/src/audio.rs +++ b/lunabotics/lunabot/src/audio.rs @@ -8,17 +8,14 @@ static SINK: OnceLock> = OnceLock::new(); pub fn init_buzz() { let mut sinks = vec![]; - for device in cpal::default_host().output_devices().unwrap() { - let (stream, stream_handle) = - OutputStream::try_from_device(&device).expect("Failed to open audio stream"); - std::mem::forget(stream); - let sink = Sink::try_new(&stream_handle).unwrap(); - let source = SineWave::new(300.0); - sink.append(source); - sink.pause(); - sinks.push(sink); - log::info!("Audio device: {}", device.name().unwrap()); - } + let (stream, stream_handle) = + OutputStream::try_default().expect("Failed to open audio stream"); + std::mem::forget(stream); + let sink = Sink::try_new(&stream_handle).unwrap(); + let source = SineWave::new(300.0); + sink.append(source); + sink.pause(); + sinks.push(sink); let Ok(()) = SINK.set(sinks.into_boxed_slice()) else { unreachable!(); };