Skip to content

Commit

Permalink
repair vad.rs (#10)
Browse files Browse the repository at this point in the history
I get error:
index out of bounds: the len is 0 but the index is 0

Panic is very surprising!

I think that this is reverse.
  • Loading branch information
oligamiq authored Jul 29, 2024
1 parent 9150ec6 commit ea8929c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mel_spec/src/vad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ impl VoiceActivityDetector {
let edge_info = vad_boundaries(&window, &self.settings);
let ni = edge_info.intersected();
if ni.is_empty() {
Some(ni[0] == 0)
} else {
Some(false)
} else {
Some(ni[0] == 0)
}
}
}
Expand Down

0 comments on commit ea8929c

Please sign in to comment.