rust-whisper-baked can list input devices

This commit is contained in:
Bel LaPointe
2023-12-20 22:12:35 -05:00
parent e27a8f8f56
commit 5c34112c0c
3 changed files with 26 additions and 5 deletions

View File

@@ -29,6 +29,8 @@ pub struct Flags {
#[arg(long, default_value = None)]
pub wav: Option<String>,
#[arg(long, default_value = None)]
pub stream_device: Option<String>,
}
pub fn wav<F>(flags: Flags, handler_fn: F, wav_path: String) where F: FnMut(Result<Transcribed, String>) + Send + 'static {
@@ -334,6 +336,7 @@ mod tests {
stream_tail: 0.0,
wav: Some("../gitea-whisper-rs/sys/whisper.cpp/bindings/go/samples/jfk.wav".to_string()),
debug: false,
stream_device: None,
},
| result | {
assert!(result.is_ok());