blob: 564b068ef7e63c6b8e707c81961c0ad2e0c2c13a [file] [log] [blame]
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +00001/*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef WEBRTC_VOICE_ENGINE_LEVEL_INDICATOR_H
12#define WEBRTC_VOICE_ENGINE_LEVEL_INDICATOR_H
13
14#include "typedefs.h"
15#include "voice_engine_defines.h"
16
17namespace webrtc {
18
19class AudioFrame;
20namespace voe {
21
22class AudioLevel
23{
24public:
25 AudioLevel();
26 virtual ~AudioLevel();
27
28 void ComputeLevel(const AudioFrame& audioFrame);
29
30 WebRtc_Word8 Level() const;
31
32 WebRtc_Word16 LevelFullRange() const;
33
34 void Clear();
35
36private:
37 enum { kUpdateFrequency = 10};
38
39 WebRtc_Word16 _absMax;
40 WebRtc_Word16 _count;
41 WebRtc_Word8 _currentLevel;
42 WebRtc_Word16 _currentLevelFullRange;
43};
44
45} // namespace voe
46
47} // namespace webrtc
48
49#endif // WEBRTC_VOICE_ENGINE_LEVEL_INDICATOR_H