OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 16 matching lines...) Expand all Loading... |
27 if (*wav_file) { | 27 if (*wav_file) { |
28 if (rtc_WavSampleRate(*wav_file) == sample_rate) | 28 if (rtc_WavSampleRate(*wav_file) == sample_rate) |
29 return; | 29 return; |
30 rtc_WavClose(*wav_file); | 30 rtc_WavClose(*wav_file); |
31 } | 31 } |
32 char filename[64]; | 32 char filename[64]; |
33 int written = rtc::sprintfn(filename, sizeof(filename), "%s%d-%d.wav", name, | 33 int written = rtc::sprintfn(filename, sizeof(filename), "%s%d-%d.wav", name, |
34 instance_index, process_rate); | 34 instance_index, process_rate); |
35 | 35 |
36 // Ensure there was no buffer output error. | 36 // Ensure there was no buffer output error. |
37 DCHECK_GE(written, 0); | 37 RTC_DCHECK_GE(written, 0); |
38 // Ensure that the buffer size was sufficient. | 38 // Ensure that the buffer size was sufficient. |
39 DCHECK_LT(static_cast<size_t>(written), sizeof(filename)); | 39 RTC_DCHECK_LT(static_cast<size_t>(written), sizeof(filename)); |
40 | 40 |
41 *wav_file = rtc_WavOpen(filename, sample_rate, 1); | 41 *wav_file = rtc_WavOpen(filename, sample_rate, 1); |
42 } | 42 } |
43 | 43 |
44 void WebRtcAec_RawFileOpen(const char* name, int instance_index, FILE** file) { | 44 void WebRtcAec_RawFileOpen(const char* name, int instance_index, FILE** file) { |
45 char filename[64]; | 45 char filename[64]; |
46 int written = rtc::sprintfn(filename, sizeof(filename), "%s_%d.dat", name, | 46 int written = rtc::sprintfn(filename, sizeof(filename), "%s_%d.dat", name, |
47 instance_index); | 47 instance_index); |
48 | 48 |
49 // Ensure there was no buffer output error. | 49 // Ensure there was no buffer output error. |
50 DCHECK_GE(written, 0); | 50 RTC_DCHECK_GE(written, 0); |
51 // Ensure that the buffer size was sufficient. | 51 // Ensure that the buffer size was sufficient. |
52 DCHECK_LT(static_cast<size_t>(written), sizeof(filename)); | 52 RTC_DCHECK_LT(static_cast<size_t>(written), sizeof(filename)); |
53 | 53 |
54 *file = fopen(filename, "wb"); | 54 *file = fopen(filename, "wb"); |
55 } | 55 } |
56 | 56 |
57 #endif // WEBRTC_AEC_DEBUG_DUMP | 57 #endif // WEBRTC_AEC_DEBUG_DUMP |
OLD | NEW |