Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: webrtc/modules/audio_processing/logging/aec_logging_file_handling.c

Issue 1272403003: Replaced the wav file dumping functionality in aec_core.c with the newly added corresponding macros (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Code update according to reviewer comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2015 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 #include <assert.h>
12 #include <stdint.h>
13 #include <stdio.h>
14
15 #include "webrtc/common_audio/wav_file.h"
16 #include "webrtc/typedefs.h"
17 #include "webrtc/modules/audio_processing/logging/aec_logging_file_handling.h"
18
19 #ifdef WEBRTC_AEC_DEBUG_DUMP
20 void WebRtcAec_ReopenWav(const char* name,
21 int instance_index,
22 int process_rate,
23 int sample_rate,
24 rtc_WavWriter** wav_file) {
25 int written ATTRIBUTE_UNUSED;
26 char filename[64];
27 if (*wav_file) {
28 if (rtc_WavSampleRate(*wav_file) == sample_rate)
29 return;
30 rtc_WavClose(*wav_file);
31 }
32 written = snprintf(filename, sizeof(filename), "%s%d-%d.wav",
33 name, instance_index, process_rate);
34 assert(written >= 0); // no output error
35 assert((size_t)written < sizeof(filename)); // buffer was large enough
36 *wav_file = rtc_WavOpen(filename, sample_rate, 1);
37 }
38
39
40 void WebRtcAec_RawFileOpen(const char* name,
41 int instance_counter,
42 FILE** file) {
43 int written ATTRIBUTE_UNUSED;
44 char filename[64];
45
46 written = snprintf(filename, sizeof(filename), "%s_%d.dat",
47 name, instance_counter);
48 assert(written >= 0); // no output error
49 assert((size_t)written < sizeof(filename)); // buffer was large enough
50
51 *file = fopen(filename, "wb");
52 }
53
54
55 #endif // WEBRTC_AEC_DEBUG_DUMP
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698