Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Jun 29, 2024
1 parent 9ce920e commit f53c27a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions sherpa-onnx/csrc/silero-vad-model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@ class SileroVadModel::Impl {
states_.push_back(std::move(c));
}

void Check() {
void Check() const {
if (is_v5_) {
CheckV5();
} else {
CheckV4();
}
}

void CheckV4() {
void CheckV4() const {
if (input_names_.size() != 4) {
SHERPA_ONNX_LOGE("Expect 4 inputs. Given: %d",
static_cast<int32_t>(input_names_.size()));
Expand Down Expand Up @@ -290,7 +290,7 @@ class SileroVadModel::Impl {
}
}

void CheckV5() {
void CheckV5() const {
if (input_names_.size() != 3) {
SHERPA_ONNX_LOGE("Expect 3 inputs. Given: %d",
static_cast<int32_t>(input_names_.size()));
Expand Down
5 changes: 3 additions & 2 deletions sherpa-onnx/csrc/silero-vad-model.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ class SileroVadModel : public VadModel {

int32_t WindowSize() const override;

// For silero vad V4, it is 0.
// For silero vad V5, it is 512-64 for 16kHz and 512-32 for 8kHz
// For silero vad V4, it is WindowSize().
// For silero vad V5, it is WindowSize()-64 for 16kHz and
// WindowSize()-32 for 8kHz
int32_t WindowShift() const override;

int32_t MinSilenceDurationSamples() const override;
Expand Down

0 comments on commit f53c27a

Please sign in to comment.