Convert audio to 8kHz before feeding it to WebRTC for VAC

This prevents false positives at the beginning of the audio stream. Fixes issue #52.
This commit is contained in:
Daniel Wolf 2019-01-04 20:23:57 +01:00
parent 10632576bd
commit a723942f22
2 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
## Unreleased
* **Added** basic support for non-English recordings through phonetic recognition ([issue #45](https://github.com/DanielSWolf/rhubarb-lip-sync/issues/45)).
* **Fixed** a bug that resulted in unwanted mouth movement at beginning of a recording ([issue #53](https://github.com/DanielSWolf/rhubarb-lip-sync/issues/53)).
* **Fixed** a bug that prevented the progress bar from reaching 100% ([issue #48](https://github.com/DanielSWolf/rhubarb-lip-sync/issues/48)).
## Version 1.8.0

View File

@ -83,7 +83,7 @@ JoiningBoundedTimeline<void> detectVoiceActivity(
) {
// Prepare audio for VAD
const unique_ptr<AudioClip> audioClip = inputAudioClip.clone()
| resample(16000)
| resample(8000) // Convert to the internal sampling rate of WebRTC
| removeDcOffset();
JoiningBoundedTimeline<void> activity(audioClip->getTruncatedRange());