OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP | 42 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP |
43 namespace audioproc { | 43 namespace audioproc { |
44 | 44 |
45 class Event; | 45 class Event; |
46 | 46 |
47 } // namespace audioproc | 47 } // namespace audioproc |
48 #endif | 48 #endif |
49 | 49 |
50 class AudioRate { | 50 class AudioRate { |
51 public: | 51 public: |
52 explicit AudioRate(int sample_rate_hz) | 52 explicit AudioRate(int sample_rate_hz) { set(sample_rate_hz); } |
53 : rate_(sample_rate_hz), | |
54 samples_per_channel_(AudioProcessing::kChunkSizeMs * rate_ / 1000) {} | |
55 virtual ~AudioRate() {} | 53 virtual ~AudioRate() {} |
56 | 54 |
57 void set(int rate) { | 55 void set(int rate) { |
58 rate_ = rate; | 56 rate_ = rate; |
59 samples_per_channel_ = AudioProcessing::kChunkSizeMs * rate_ / 1000; | 57 samples_per_channel_ = AudioProcessing::kChunkSizeMs * rate_ / 1000; |
60 } | 58 } |
61 | 59 |
62 int rate() const { return rate_; } | 60 int rate() const { return rate_; } |
63 int samples_per_channel() const { return samples_per_channel_; } | 61 int samples_per_channel() const { return samples_per_channel_; } |
64 | 62 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 const bool beamformer_enabled_; | 222 const bool beamformer_enabled_; |
225 rtc::scoped_ptr<Beamformer<float>> beamformer_; | 223 rtc::scoped_ptr<Beamformer<float>> beamformer_; |
226 const std::vector<Point> array_geometry_; | 224 const std::vector<Point> array_geometry_; |
227 | 225 |
228 const bool supports_48kHz_; | 226 const bool supports_48kHz_; |
229 }; | 227 }; |
230 | 228 |
231 } // namespace webrtc | 229 } // namespace webrtc |
232 | 230 |
233 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ | 231 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ |
OLD | NEW |