| 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 12 matching lines...) Expand all Loading... |
| 23 // respectively, on the keypad as illustrated below. | 23 // respectively, on the keypad as illustrated below. |
| 24 // | 24 // |
| 25 // 1209 Hz 1336 Hz 1477 Hz 1633 Hz | 25 // 1209 Hz 1336 Hz 1477 Hz 1633 Hz |
| 26 // 697 Hz 1 2 3 12 | 26 // 697 Hz 1 2 3 12 |
| 27 // 770 Hz 4 5 6 13 | 27 // 770 Hz 4 5 6 13 |
| 28 // 852 Hz 7 8 9 14 | 28 // 852 Hz 7 8 9 14 |
| 29 // 941 Hz 10 0 11 15 | 29 // 941 Hz 10 0 11 15 |
| 30 | 30 |
| 31 #include "webrtc/modules/audio_coding/neteq/dtmf_tone_generator.h" | 31 #include "webrtc/modules/audio_coding/neteq/dtmf_tone_generator.h" |
| 32 | 32 |
| 33 #include "webrtc/base/arraysize.h" | 33 #include "webrtc/rtc_base/arraysize.h" |
| 34 #include "webrtc/base/checks.h" | 34 #include "webrtc/rtc_base/checks.h" |
| 35 | 35 |
| 36 namespace webrtc { | 36 namespace webrtc { |
| 37 | 37 |
| 38 // The filter coefficient a = 2*cos(2*pi*f/fs) for the low frequency tone, for | 38 // The filter coefficient a = 2*cos(2*pi*f/fs) for the low frequency tone, for |
| 39 // sample rates fs = {8000, 16000, 32000, 48000} Hz, and events 0 through 15. | 39 // sample rates fs = {8000, 16000, 32000, 48000} Hz, and events 0 through 15. |
| 40 // Values are in Q14. | 40 // Values are in Q14. |
| 41 const int DtmfToneGenerator::kCoeff1[4][16] = { | 41 const int DtmfToneGenerator::kCoeff1[4][16] = { |
| 42 { 24219, 27980, 27980, 27980, 26956, 26956, 26956, 25701, 25701, 25701, | 42 { 24219, 27980, 27980, 27980, 26956, 26956, 26956, 25701, 25701, 25701, |
| 43 24219, 24219, 27980, 26956, 25701, 24219 }, | 43 24219, 24219, 27980, 26956, 25701, 24219 }, |
| 44 { 30556, 31548, 31548, 31548, 31281, 31281, 31281, 30951, 30951, 30951, | 44 { 30556, 31548, 31548, 31548, 31281, 31281, 31281, 30951, 30951, 30951, |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 209 } |
| 210 | 210 |
| 211 return static_cast<int>(num_samples); | 211 return static_cast<int>(num_samples); |
| 212 } | 212 } |
| 213 | 213 |
| 214 bool DtmfToneGenerator::initialized() const { | 214 bool DtmfToneGenerator::initialized() const { |
| 215 return initialized_; | 215 return initialized_; |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace webrtc | 218 } // namespace webrtc |
| OLD | NEW |