OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 |
11 // Modified from the Chromium original here: | 11 // Modified from the Chromium original here: |
12 // src/media/base/sinc_resampler_unittest.cc | 12 // src/media/base/sinc_resampler_unittest.cc |
13 | 13 |
14 #ifndef WEBRTC_COMMON_AUDIO_RESAMPLER_SINUSOIDAL_LINEAR_CHIRP_SOURCE_H_ | 14 #ifndef WEBRTC_COMMON_AUDIO_RESAMPLER_SINUSOIDAL_LINEAR_CHIRP_SOURCE_H_ |
15 #define WEBRTC_COMMON_AUDIO_RESAMPLER_SINUSOIDAL_LINEAR_CHIRP_SOURCE_H_ | 15 #define WEBRTC_COMMON_AUDIO_RESAMPLER_SINUSOIDAL_LINEAR_CHIRP_SOURCE_H_ |
16 | 16 |
| 17 #include "webrtc/base/constructormagic.h" |
17 #include "webrtc/common_audio/resampler/sinc_resampler.h" | 18 #include "webrtc/common_audio/resampler/sinc_resampler.h" |
18 #include "webrtc/rtc_base/constructormagic.h" | |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 | 21 |
22 // Fake audio source for testing the resampler. Generates a sinusoidal linear | 22 // Fake audio source for testing the resampler. Generates a sinusoidal linear |
23 // chirp (http://en.wikipedia.org/wiki/Chirp) which can be tuned to stress the | 23 // chirp (http://en.wikipedia.org/wiki/Chirp) which can be tuned to stress the |
24 // resampler for the specific sample rate conversion being used. | 24 // resampler for the specific sample rate conversion being used. |
25 class SinusoidalLinearChirpSource : public SincResamplerCallback { | 25 class SinusoidalLinearChirpSource : public SincResamplerCallback { |
26 public: | 26 public: |
27 // |delay_samples| can be used to insert a fractional sample delay into the | 27 // |delay_samples| can be used to insert a fractional sample delay into the |
28 // source. It will produce zeros until non-negative time is reached. | 28 // source. It will produce zeros until non-negative time is reached. |
(...skipping 17 matching lines...) Expand all Loading... |
46 double k_; | 46 double k_; |
47 size_t current_index_; | 47 size_t current_index_; |
48 double delay_samples_; | 48 double delay_samples_; |
49 | 49 |
50 RTC_DISALLOW_COPY_AND_ASSIGN(SinusoidalLinearChirpSource); | 50 RTC_DISALLOW_COPY_AND_ASSIGN(SinusoidalLinearChirpSource); |
51 }; | 51 }; |
52 | 52 |
53 } // namespace webrtc | 53 } // namespace webrtc |
54 | 54 |
55 #endif // WEBRTC_COMMON_AUDIO_RESAMPLER_SINUSOIDAL_LINEAR_CHIRP_SOURCE_H_ | 55 #endif // WEBRTC_COMMON_AUDIO_RESAMPLER_SINUSOIDAL_LINEAR_CHIRP_SOURCE_H_ |
OLD | NEW |