no callback on empty str
This commit is contained in:
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user