Update to current webrtc library
This is from the upstream library commit id 3326535126e435f1ba647885ce43a8f0f3d317eb, corresponding to Chromium 88.0.4290.1.
This commit is contained in:
@ -8,17 +8,16 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/modules/audio_processing/vad/voice_activity_detector.h"
|
||||
#include "modules/audio_processing/vad/voice_activity_detector.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "rtc_base/checks.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
|
||||
const size_t kMaxLength = 320;
|
||||
const int kNumChannels = 1;
|
||||
const size_t kNumChannels = 1;
|
||||
|
||||
const double kDefaultVoiceValue = 1.0;
|
||||
const double kNeutralProbability = 0.5;
|
||||
@ -28,8 +27,9 @@ const double kLowProbability = 0.01;
|
||||
|
||||
VoiceActivityDetector::VoiceActivityDetector()
|
||||
: last_voice_probability_(kDefaultVoiceValue),
|
||||
standalone_vad_(StandaloneVad::Create()) {
|
||||
}
|
||||
standalone_vad_(StandaloneVad::Create()) {}
|
||||
|
||||
VoiceActivityDetector::~VoiceActivityDetector() = default;
|
||||
|
||||
// Because ISAC has a different chunk length, it updates
|
||||
// |chunkwise_voice_probabilities_| and |chunkwise_rms_| when there is new data.
|
||||
@ -37,8 +37,7 @@ VoiceActivityDetector::VoiceActivityDetector()
|
||||
void VoiceActivityDetector::ProcessChunk(const int16_t* audio,
|
||||
size_t length,
|
||||
int sample_rate_hz) {
|
||||
RTC_DCHECK_EQ(static_cast<int>(length), sample_rate_hz / 100);
|
||||
RTC_DCHECK_LE(length, kMaxLength);
|
||||
RTC_DCHECK_EQ(length, sample_rate_hz / 100);
|
||||
// Resample to the required rate.
|
||||
const int16_t* resampled_ptr = audio;
|
||||
if (sample_rate_hz != kSampleRateHz) {
|
||||
|
Reference in New Issue
Block a user