no panic on unusable mic
This commit is contained in:
@@ -68,10 +68,14 @@ fn channel(flags: rust_whisper_lib::Flags) {
|
||||
let flags = rust_whisper_lib::Flags::parse();
|
||||
match flags.stream_device {
|
||||
Some(device_name) => {
|
||||
if device_name == "" {
|
||||
eprintln!("with device ({}) '{}'", device_name.len(), &device_name);
|
||||
if device_name.len() == 0 {
|
||||
let mut i = 0;
|
||||
for device in listen_lib::devices() {
|
||||
eprintln!("{}", device);
|
||||
eprintln!("[{}] {}", i, device);
|
||||
i += 1;
|
||||
}
|
||||
eprintln!("found {} devices", i);
|
||||
} else {
|
||||
listen_lib::main_with(|data| {
|
||||
send.send(data).unwrap();
|
||||
@@ -79,6 +83,7 @@ fn channel(flags: rust_whisper_lib::Flags) {
|
||||
}
|
||||
},
|
||||
None => {
|
||||
eprintln!("without any device");
|
||||
listen_lib::main(|data| {
|
||||
send.send(data).unwrap();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user