Revert "Reland "Remove unused APM voice activity detection sub-module""
This reverts commit 54d1344d985b00d4d1580dd18057d4618c11ad1f.
Reason for revert: Breaks chromium roll, see
https://ci.chromium.org/ui/p/chromium/builders/try/linux_chromium_tsan_rel_ng/1080583/overview
https://chromium-review.googlesource.com/c/chromium/src/+/3461512
Original change's description:
> Reland "Remove unused APM voice activity detection sub-module"
>
> This reverts commit a751f167c68343f76528436defdbc61600a8d7b3.
>
> Reason for revert: dependency in a downstream project removed
>
> Original change's description:
> > Revert "Remove unused APM voice activity detection sub-module"
> >
> > This reverts commit b4e06d032e6f82a65c52ed0c5364ae9e7c0a0215.
> >
> > Reason for revert: breaking downstream projects
> >
> > Original change's description:
> > > Remove unused APM voice activity detection sub-module
> > >
> > > API changes:
> > > - webrtc::AudioProcessing::Config::VoiceDetection removed
> > > - webrtc::AudioProcessingStats::voice_detected deprecated
> > > - cricket::AudioOptions::typing_detection deprecated
> > > - webrtc::StatsReport::StatsValueName::
> > > kStatsValueNameTypingNoiseState deprecated
> > >
> > > PSA: https://groups.google.com/g/discuss-webrtc/c/7X6uwmJarE0
> > >
> > > Bug: webrtc:11226,webrtc:11292
> > > Change-Id: I8d008b56708cf62961b9857ec052b59fda3b41bf
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250666
> > > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> > > Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> > > Reviewed-by: Björn Terelius <terelius@webrtc.org>
> > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> > > Cr-Commit-Position: refs/heads/main@{#35975}
> >
> > TBR=gustaf@webrtc.org,saza@webrtc.org,alessiob@webrtc.org,terelius@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
> >
> > Change-Id: Iee01fdb874b4e0331277f3ffe60dacaabc3859a2
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: webrtc:11226,webrtc:11292
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251600
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35977}
>
> # Not skipping CQ checks because this is a reland.
>
> Bug: webrtc:11226,webrtc:11292
> Change-Id: I2fcbc5fdade16bfe6a0f0a02841a33a598d4f2ad
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251660
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35984}
TBR=mbonadei@webrtc.org,gustaf@webrtc.org,saza@webrtc.org,alessiob@webrtc.org,terelius@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: Ib308a3af2dcce85a0074ef5a4680ccec3f82712f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11226,webrtc:11292
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251688
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35990}
diff --git a/modules/audio_processing/include/audio_processing.cc b/modules/audio_processing/include/audio_processing.cc
index 86edaee..9643b6c 100644
--- a/modules/audio_processing/include/audio_processing.cc
+++ b/modules/audio_processing/include/audio_processing.cc
@@ -145,6 +145,7 @@
<< NoiseSuppressionLevelToString(noise_suppression.level)
<< " }, transient_suppression: { enabled: "
<< transient_suppression.enabled
+ << " }, voice_detection: { enabled: " << voice_detection.enabled
<< " }, gain_controller1: { enabled: " << gain_controller1.enabled
<< ", mode: " << GainController1ModeToString(gain_controller1.mode)
<< ", target_level_dbfs: " << gain_controller1.target_level_dbfs
diff --git a/modules/audio_processing/include/audio_processing.h b/modules/audio_processing/include/audio_processing.h
index 9d6824c..8af5013 100644
--- a/modules/audio_processing/include/audio_processing.h
+++ b/modules/audio_processing/include/audio_processing.h
@@ -113,6 +113,8 @@
//
// config.high_pass_filter.enabled = true;
//
+// config.voice_detection.enabled = true;
+//
// apm->ApplyConfig(config)
//
// apm->noise_reduction()->set_level(kHighSuppression);
@@ -230,6 +232,11 @@
bool enabled = false;
} transient_suppression;
+ // Enables reporting of `voice_detected` in webrtc::AudioProcessingStats.
+ struct VoiceDetection {
+ bool enabled = false;
+ } voice_detection;
+
// Enables automatic gain control (AGC) functionality.
// The automatic gain control (AGC) component brings the signal to an
// appropriate range. This is done by applying a digital gain directly and,
diff --git a/modules/audio_processing/include/audio_processing_statistics.h b/modules/audio_processing/include/audio_processing_statistics.h
index 3b43319..a31dafe 100644
--- a/modules/audio_processing/include/audio_processing_statistics.h
+++ b/modules/audio_processing/include/audio_processing_statistics.h
@@ -24,8 +24,6 @@
AudioProcessingStats(const AudioProcessingStats& other);
~AudioProcessingStats();
- // Deprecated.
- // TODO(bugs.webrtc.org/11226): Remove.
// True if voice is detected in the last capture frame, after processing.
// It is conservative in flagging audio as speech, with low likelihood of
// incorrectly flagging a frame as voice.