Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 26 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion desktop/src/gui/dialogs/preferences_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
8 changes: 5 additions & 3 deletions frontend-utils/src/backends/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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);
}
Expand Down
Loading