Add BackendSpecificError. Add new DevicesError.
See the documentation for both new errors for details. The new `DevicesError` has been added to allow for returning errors when enumerating devices. This has allowed to remove multiple potential `panic!`s in each of the alsa, coreaudio and wasapi backends.
This commit is contained in:
parent
cf84ab906f
commit
42fc702f53
8 changed files with 140 additions and 63 deletions
|
|
@ -4,7 +4,7 @@ fn main() {
|
|||
println!("Default Input Device:\n {:?}", cpal::default_input_device().map(|e| e.name()));
|
||||
println!("Default Output Device:\n {:?}", cpal::default_output_device().map(|e| e.name()));
|
||||
|
||||
let devices = cpal::devices();
|
||||
let devices = cpal::devices().expect("failed to enumerate devices");
|
||||
println!("Devices: ");
|
||||
for (device_index, device) in devices.enumerate() {
|
||||
println!("{}. \"{}\"",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue