diff --git a/Cargo.lock b/Cargo.lock index 03a8dcc1eb8b..2f1c973f78c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -54,9 +54,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "alsa" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed7572b7ba83a31e20d1b48970ee402d2e3e0537dcfe0a3ff4d6eb7508617d43" +checksum = "7c88dbbce13b232b26250e1e2e6ac18b6a891a646b8148285036ebce260ac5c3" dependencies = [ "alsa-sys", "bitflags 2.10.0", @@ -916,9 +916,9 @@ dependencies = [ [[package]] name = "cpal" -version = "0.16.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbd307f43cc2a697e2d1f8bc7a1d824b5269e052209e28883e5bc04d095aaa3f" +checksum = "5b1f9c7312f19fc2fa12fd7acaf38de54e8320ba10d1a02dcbe21038def51ccb" dependencies = [ "alsa", "coreaudio-rs", @@ -931,13 +931,17 @@ dependencies = [ "ndk-context", "num-derive", "num-traits", + "objc2 0.6.3", "objc2-audio-toolbox", + "objc2-avf-audio", "objc2-core-audio", "objc2-core-audio-types", + "objc2-core-foundation", + "objc2-foundation 0.3.2", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows 0.54.0", + "windows 0.62.2", ] [[package]] @@ -3006,9 +3010,9 @@ dependencies = [ [[package]] name = "mach2" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" +checksum = "6a1b95cd5421ec55b445b5ae102f5ea0e768de1f82bd3001e11f426c269c3aea" dependencies = [ "libc", ] @@ -3450,6 +3454,16 @@ dependencies = [ "objc2-foundation 0.3.2", ] +[[package]] +name = "objc2-avf-audio" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13a380031deed8e99db00065c45937da434ca987c034e13b87e4441f9e4090be" +dependencies = [ + "objc2 0.6.3", + "objc2-foundation 0.3.2", +] + [[package]] name = "objc2-cloud-kit" version = "0.2.2" @@ -3484,6 +3498,7 @@ dependencies = [ "objc2 0.6.3", "objc2-core-audio-types", "objc2-core-foundation", + "objc2-foundation 0.3.2", ] [[package]] @@ -3515,7 +3530,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ "bitflags 2.10.0", + "block2 0.6.2", "dispatch2", + "libc", "objc2 0.6.3", ] @@ -3582,6 +3599,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" dependencies = [ "bitflags 2.10.0", + "block2 0.6.2", + "libc", "objc2 0.6.3", "objc2-core-foundation", ] @@ -6683,16 +6702,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.54.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" -dependencies = [ - "windows-core 0.54.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows" version = "0.58.0" @@ -6724,16 +6733,6 @@ dependencies = [ "windows-core 0.62.2", ] -[[package]] -name = "windows-core" -version = "0.54.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" -dependencies = [ - "windows-result 0.1.2", - "windows-targets 0.52.6", -] - [[package]] name = "windows-core" version = "0.58.0" @@ -6842,15 +6841,6 @@ dependencies = [ "windows-strings 0.5.1", ] -[[package]] -name = "windows-result" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-result" version = "0.2.0" diff --git a/Cargo.toml b/Cargo.toml index 86745a2eb865..3384ab739006 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ naga = { version = "27.0.3", features = ["wgsl-out"] } wgpu = "27.0.1" egui = "0.33.3" clap = { version = "4.5.54", features = ["derive"] } -cpal = "0.16.0" +cpal = "0.17.1" anyhow = "1.0" gc-arena = { git = "https://github.com/kyren/gc-arena.git", rev = "08e08414249d5914dfc3b402d7eadc133e00ce56" } slotmap = "1.1.1" diff --git a/desktop/src/gui/dialogs/preferences_dialog.rs b/desktop/src/gui/dialogs/preferences_dialog.rs index 894b7c5a2a05..c6d33b0d1ac2 100644 --- a/desktop/src/gui/dialogs/preferences_dialog.rs +++ b/desktop/src/gui/dialogs/preferences_dialog.rs @@ -64,7 +64,7 @@ impl PreferencesDialog { let mut available_output_devices = Vec::new(); if let Ok(devices) = audio_host.output_devices() { for device in devices { - if let Ok(name) = device.name() { + if let Ok(name) = device.description().map(|d| d.name().to_owned()) { available_output_devices.push(name); } } diff --git a/frontend-utils/src/backends/audio.rs b/frontend-utils/src/backends/audio.rs index 07f01d05a8b1..dcc8a453fbeb 100644 --- a/frontend-utils/src/backends/audio.rs +++ b/frontend-utils/src/backends/audio.rs @@ -46,7 +46,7 @@ impl CpalAudioBackend { .map_err(CpalError::DefaultStream)?; let sample_format = config.sample_format(); let config = cpal::StreamConfig::from(config); - let mixer = AudioMixer::new(config.channels as u8, config.sample_rate.0); + let mixer = AudioMixer::new(config.channels as u8, config.sample_rate); // Start the audio stream. let stream = { @@ -114,8 +114,10 @@ fn get_suitable_output_device( // First let's check for any user preference... if let Some(preferred_device_name) = preferred_device_name && let Ok(mut devices) = host.output_devices() - && let Some(device) = - devices.find(|device| device.name().ok().as_deref() == Some(preferred_device_name)) + && let Some(device) = devices.find(|device| { + device.description().ok().map(|d| d.name().to_owned()) + == Some(preferred_device_name.to_owned()) + }) { return Some(device); }