From a723942f2218c8acd60c7f2bdadef9f799a13e80 Mon Sep 17 00:00:00 2001 From: Daniel Wolf Date: Fri, 4 Jan 2019 20:23:57 +0100 Subject: [PATCH] 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. --- CHANGELOG.md | 1 + rhubarb/src/audio/voiceActivityDetection.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4e388b..bf8adfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/rhubarb/src/audio/voiceActivityDetection.cpp b/rhubarb/src/audio/voiceActivityDetection.cpp index 990ae88..8de372c 100644 --- a/rhubarb/src/audio/voiceActivityDetection.cpp +++ b/rhubarb/src/audio/voiceActivityDetection.cpp @@ -83,7 +83,7 @@ JoiningBoundedTimeline detectVoiceActivity( ) { // Prepare audio for VAD const unique_ptr audioClip = inputAudioClip.clone() - | resample(16000) + | resample(8000) // Convert to the internal sampling rate of WebRTC | removeDcOffset(); JoiningBoundedTimeline activity(audioClip->getTruncatedRange());