Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rate-limit second-pass VAD #10

Merged
merged 3 commits into from
May 18, 2021
Merged

Rate-limit second-pass VAD #10

merged 3 commits into from
May 18, 2021

Conversation

tmacwill
Copy link
Member

it can be expensive to call the second-pass VAD, so provide a mechanism
to rate-limit how often it's called.

it can be expensive to call the second-pass VAD, so provide a mechanism
to rate-limit how often it's called.
index.ts Outdated
@@ -148,6 +149,9 @@ export class SpeechRecorder {
if (!this.disableSecondPass && speaking && this.vadBuffer.length == this.vadBufferSize) {
probability = await this.vad.process([].concat(...this.vadBuffer));
speaking = probability > this.vadThreshold;
if (speaking && this.vadRateLimit > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the second term always evaluate to 0 > 0 and so the condition is always false?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh thanks, forgot to add an option, was just testing by manually changing this value

@tmacwill tmacwill merged commit f19c149 into master May 18, 2021
@tmacwill tmacwill deleted the vad-rate-limit branch November 19, 2021 22:43
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.

2 participants