Skip to content

Commit

Permalink
fix: filter empty segment chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
ckaznable committed May 25, 2023
1 parent 9b9ab81 commit 3abcb8a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/speech.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ pub fn process<F: FnMut(&str, i64)>(
(state.full_get_segment_text(i), state.full_get_segment_t0(i))
{
if last_segment != segment {
f(process_segment(segment.as_ref()).as_ref(), start_timestamp);
let segment = process_segment(segment.as_ref());
if !segment.is_empty() {
f(&segment, start_timestamp);
}
}

last_segment = segment;
Expand Down

0 comments on commit 3abcb8a

Please sign in to comment.