Skip to content

Add SILK VAD (voice activity detection)#155

Merged
thomas-vilte merged 1 commit into
pion:mainfrom
thomas-vilte:feat/silk-vad
Jul 20, 2026
Merged

Add SILK VAD (voice activity detection)#155
thomas-vilte merged 1 commit into
pion:mainfrom
thomas-vilte:feat/silk-vad

Conversation

@thomas-vilte

Copy link
Copy Markdown
Member

Description

ports the SILK voice activity detector: speech activity estimation (VAD.c's silk_VAD_GetSA_Q8), the per-band noise-level tracker (silk_VAD_GetNoiseLevels), the 2-band analysis filter bank (ana_filt_bank_1.c), and the pitch-adaptive high-pass cutoff (HP_variable_cutoff.c). Only depends on the math primitives from #153, nothing else

went through it function by function against the real C source and it lines up exactly — every constant, shift and branch. the first test pass left a few branches uncovered though: the high-energy division path in the SNR ratio calc, the mid-power-level scaling branch, and the decreasing-pitch case in the cutoff adaptation. one of those (the mid-power branch) needed a specific amplitude to land in — ended up temporarily instrumenting the function with a print statement to see the actual internal value across a few amplitudes, found one that lands there reliably, then pulled the print back out. all five functions are at 100% now

Reference issue

part of the SILK encoder series (#147)

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.40%. Comparing base (4bed3b6) to head (fcc434b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #155      +/-   ##
==========================================
+ Coverage   88.19%   88.40%   +0.20%     
==========================================
  Files          34       35       +1     
  Lines        7868     8010     +142     
==========================================
+ Hits         6939     7081     +142     
  Misses        703      703              
  Partials      226      226              
Flag Coverage Δ
go 88.40% <100.00%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thomas-vilte
thomas-vilte merged commit 4221339 into pion:main Jul 20, 2026
20 checks passed
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