mirror of
https://github.com/csd4ni3l/soundboard.git
synced 2026-03-10 09:09:24 +01:00
Fix Windows build crashing because virtual_mic is Option Device not just Device (not inside let Some)
This commit is contained in:
@@ -59,8 +59,23 @@ pub fn create_virtual_mic_windows() -> (OutputStream, OutputStream) {
|
|||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
});
|
});
|
||||||
|
|
||||||
if let Some(virtual_mic) = virtual_mic {
|
if let Some(virtual_mic) = virtual_mic {
|
||||||
// nothing, let Some doesnt support !
|
route_standard_to_virtual(&host, &virtual_mic);
|
||||||
|
|
||||||
|
let normal_output = host
|
||||||
|
.default_output_device()
|
||||||
|
.expect("Could not get default output device");
|
||||||
|
|
||||||
|
return (
|
||||||
|
OutputStreamBuilder::from_device(normal_output)
|
||||||
|
.expect("Unable to open default audio device")
|
||||||
|
.open_stream()
|
||||||
|
.expect("Failed to open stream"),
|
||||||
|
OutputStreamBuilder::from_device(virtual_mic)
|
||||||
|
.expect("Unable to open default audio device")
|
||||||
|
.open_stream()
|
||||||
|
.expect("Failed to open stream"),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MessageDialog::new()
|
MessageDialog::new()
|
||||||
@@ -71,21 +86,4 @@ pub fn create_virtual_mic_windows() -> (OutputStream, OutputStream) {
|
|||||||
|
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
route_standard_to_virtual(&host, &virtual_mic);
|
|
||||||
|
|
||||||
let normal_output = host
|
|
||||||
.default_output_device()
|
|
||||||
.expect("Could not get default output device");
|
|
||||||
|
|
||||||
return (
|
|
||||||
OutputStreamBuilder::from_device(normal_output)
|
|
||||||
.expect("Unable to open default audio device")
|
|
||||||
.open_stream()
|
|
||||||
.expect("Failed to open stream"),
|
|
||||||
OutputStreamBuilder::from_device(virtual_mic)
|
|
||||||
.expect("Unable to open default audio device")
|
|
||||||
.open_stream()
|
|
||||||
.expect("Failed to open stream"),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user