no callback on empty str
parent
d0dc9571d7
commit
7a5db3b2ac
|
|
@ -230,8 +230,10 @@ impl Impl {
|
||||||
let result = whispered
|
let result = whispered
|
||||||
.after(&(self.stream_head * 100.0))
|
.after(&(self.stream_head * 100.0))
|
||||||
.before(&(self.stream_tail * 100.0));
|
.before(&(self.stream_tail * 100.0));
|
||||||
|
if result.to_string().trim().len() > 0 {
|
||||||
(self.handler_fn.as_mut().unwrap())(Ok(result));
|
(self.handler_fn.as_mut().unwrap())(Ok(result));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn on_error(&mut self, msg: String) {
|
fn on_error(&mut self, msg: String) {
|
||||||
(self.handler_fn.as_mut().unwrap())(Err(format!("failed to transcribe: {}", &msg)));
|
(self.handler_fn.as_mut().unwrap())(Err(format!("failed to transcribe: {}", &msg)));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue