no callback on empty str

This commit is contained in:
Bel LaPointe
2024-01-02 16:29:58 -07:00
parent d0dc9571d7
commit 7a5db3b2ac

View File

@@ -230,8 +230,10 @@ impl Impl {
let result = whispered
.after(&(self.stream_head * 100.0))
.before(&(self.stream_tail * 100.0));
if result.to_string().trim().len() > 0 {
(self.handler_fn.as_mut().unwrap())(Ok(result));
}
}
fn on_error(&mut self, msg: String) {
(self.handler_fn.as_mut().unwrap())(Err(format!("failed to transcribe: {}", &msg)));