| Index: webrtc/voice_engine/audio_level.h
|
| diff --git a/webrtc/voice_engine/audio_level.h b/webrtc/voice_engine/audio_level.h
|
| index 3bcb0d9b4542d85ca336a7b30f7ca8c106c000f0..caecf40689ea27f9dbceeabafde5c7d761da7772 100644
|
| --- a/webrtc/voice_engine/audio_level.h
|
| +++ b/webrtc/voice_engine/audio_level.h
|
| @@ -29,11 +29,15 @@ class AudioLevel {
|
| int8_t Level() const;
|
| int16_t LevelFullRange() const;
|
| void Clear();
|
| + // See the description for "totalAudioEnergy" in the WebRTC stats spec
|
| + // (https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats-totalaudioenergy)
|
| + double TotalEnergy() const;
|
| + double TotalDuration() const;
|
|
|
| // Called on a native capture audio thread (platform dependent) from the
|
| // AudioTransport::RecordedDataIsAvailable() callback.
|
| // In Chrome, this method is called on the AudioInputDevice thread.
|
| - void ComputeLevel(const AudioFrame& audioFrame);
|
| + void ComputeLevel(const AudioFrame& audioFrame, double duration);
|
|
|
| private:
|
| enum { kUpdateFrequency = 10 };
|
| @@ -44,6 +48,9 @@ class AudioLevel {
|
| int16_t count_;
|
| int8_t current_level_;
|
| int16_t current_level_full_range_;
|
| +
|
| + double total_energy_ = 0.0;
|
| + double total_duration_ = 0.0;
|
| };
|
|
|
| } // namespace voe
|
|
|