Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

alisafaya
Copy link
Contributor

Add minimum segment length threshold to energy VAD to prevent processing short segments

speechbrain/inference/VAD.py", line 641, in create_chunks
    x = x.unfold(1, chunk_size, chunk_stride)
RuntimeError: maximum size for tensor at dimension 1 is 159 but size is 160

Added minimum segment length threshold to energy VAD function to prevent processing of very short segments. This change avoids applying unfold to segments shorter than chunk_size.

The modification adds a new parameter min_segment_length (default: 0.1 seconds) to the energy_VAD function. This enhancement is particularly useful for applications dealing with spontaneous speech or noisy environments where many short segments might be detected.

No new dependencies are required for this change. No breaking changes. The new parameter has a default value that maintains backward compatibility.

Before submitting
  • Did you read the contributor guideline?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Does your code adhere to project-specific code style and conventions?

PR review

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified
  • Confirm that the changes adhere to compatibility requirements (e.g., Python version, platform)
  • Review the self-review checklist to ensure the code is ready for review

@pplantinga pplantinga requested a review from mravanelli July 17, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.