Chromium Code Reviews| Index: content/renderer/media/media_stream_audio_processor.cc |
| diff --git a/content/renderer/media/media_stream_audio_processor.cc b/content/renderer/media/media_stream_audio_processor.cc |
| index e15e13b143c5b6e4faf5f09f43b8fcfe2fe63d38..53efaeccd22d1579b734c2e457dfe92f6581aedf 100644 |
| --- a/content/renderer/media/media_stream_audio_processor.cc |
| +++ b/content/renderer/media/media_stream_audio_processor.cc |
| @@ -245,6 +245,7 @@ MediaStreamAudioProcessor::MediaStreamAudioProcessor( |
| const MediaStreamDevice::AudioDeviceParameters& input_params, |
| WebRtcPlayoutDataSource* playout_data_source) |
| : render_delay_ms_(0), |
| + repetition_detector_(new RepetitionDetector()), |
| playout_data_source_(playout_data_source), |
| audio_mirroring_(false), |
| typing_detected_(false), |
| @@ -304,6 +305,15 @@ bool MediaStreamAudioProcessor::ProcessAndConsumeData( |
| if (!capture_fifo_->Consume(&process_bus, capture_delay)) |
| return false; |
| + // Detect if bit-exact repetition of audio present in the captured audio. |
|
Henrik Grunell
2015/09/23 10:36:41
Nit: "Detect bit-exact repetition of audio."
minyue
2015/09/25 14:40:06
Done.
|
| + // We detect only one channel. |
| + if (repetition_detector_) { |
| + repetition_detector_->Detect(process_bus->bus()->channel(0), |
|
Henrik Grunell
2015/09/23 06:54:15
How much complexity does this add? Would be good t
minyue
2015/09/23 08:48:07
It is O(n), n for number of samples. Each sample c
|
| + process_bus->bus()->frames(), |
| + 1, // number of channels |
| + input_format_.sample_rate()); |
|
Henrik Grunell
2015/09/23 06:54:15
Does the |process_bus| contain the sample rate?
minyue
2015/09/23 08:48:07
Unfortunately not. and that is why other places us
Henrik Grunell
2015/09/23 10:36:41
I looked into this more. The MediaStreamAudioBus w
minyue
2015/09/25 14:40:06
It is good for me to know that AudioBus has all in
|
| + } |
| + |
| // Use the process bus directly if audio processing is disabled. |
| MediaStreamAudioBus* output_bus = process_bus; |
| *new_volume = 0; |