blob: af85c641c7820fed5409f789807d773abeb591ab [file] [log] [blame]
andrew@webrtc.orgcb181212011-10-26 00:27:17 +00001/*
2 * Copyright (c) 2011 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// Commandline tool to unpack audioproc debug files.
12//
13// The debug files are dumped as protobuf blobs. For analysis, it's necessary
14// to unpack the file into its component parts: audio and other data.
15
16#include <stdio.h>
17
kwiberg62eaacf2016-02-17 06:39:05 -080018#include <memory>
19
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020020#include "modules/audio_processing/test/protobuf_utils.h"
21#include "modules/audio_processing/test/test_utils.h"
22#include "rtc_base/flags.h"
23#include "rtc_base/format_macros.h"
24#include "rtc_base/ignore_wundef.h"
25#include "typedefs.h"
andrew@webrtc.orgcb181212011-10-26 00:27:17 +000026
kwiberg77eab702016-09-28 17:42:01 -070027RTC_PUSH_IGNORING_WUNDEF()
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020028#include "modules/audio_processing/debug.pb.h"
kwiberg77eab702016-09-28 17:42:01 -070029RTC_POP_IGNORING_WUNDEF()
30
andrew@webrtc.orgcb181212011-10-26 00:27:17 +000031// TODO(andrew): unpack more of the data.
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +000032DEFINE_string(input_file, "input", "The name of the input stream file.");
33DEFINE_string(output_file, "ref_out",
andrew@webrtc.orgcd824382011-11-11 19:13:36 +000034 "The name of the reference output stream file.");
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +000035DEFINE_string(reverse_file, "reverse",
andrew@webrtc.orgcd824382011-11-11 19:13:36 +000036 "The name of the reverse input stream file.");
37DEFINE_string(delay_file, "delay.int32", "The name of the delay file.");
38DEFINE_string(drift_file, "drift.int32", "The name of the drift file.");
39DEFINE_string(level_file, "level.int32", "The name of the level file.");
andrew@webrtc.orgce8e0772014-02-12 15:28:30 +000040DEFINE_string(keypress_file, "keypress.bool", "The name of the keypress file.");
andrew@webrtc.orgcd824382011-11-11 19:13:36 +000041DEFINE_string(settings_file, "settings.txt", "The name of the settings file.");
42DEFINE_bool(full, false,
43 "Unpack the full set of files (normally not needed).");
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +000044DEFINE_bool(raw, false, "Write raw data instead of a WAV file.");
Bjorn Volcker40a6d592015-05-06 10:51:34 +020045DEFINE_bool(text,
46 false,
47 "Write non-audio files as text files instead of binary files.");
oprypin6e09d872017-08-31 03:21:39 -070048DEFINE_bool(help, false, "Print this message.");
andrew@webrtc.orgcb181212011-10-26 00:27:17 +000049
Minyue13b96ba2015-10-03 00:39:14 +020050#define PRINT_CONFIG(field_name) \
51 if (msg.has_##field_name()) { \
52 fprintf(settings_file, " " #field_name ": %d\n", msg.field_name()); \
53 }
54
andrew@webrtc.orga8b97372014-03-10 22:26:12 +000055namespace webrtc {
andrew@webrtc.orgcb181212011-10-26 00:27:17 +000056
andrew@webrtc.orga8b97372014-03-10 22:26:12 +000057using audioproc::Event;
58using audioproc::ReverseStream;
59using audioproc::Stream;
60using audioproc::Init;
andrew@webrtc.orgcb181212011-10-26 00:27:17 +000061
andrew@webrtc.orga8b97372014-03-10 22:26:12 +000062void WriteData(const void* data, size_t size, FILE* file,
63 const std::string& filename) {
64 if (fwrite(data, size, 1, file) != 1) {
65 printf("Error when writing to %s\n", filename.c_str());
66 exit(1);
67 }
andrew@webrtc.orgcb181212011-10-26 00:27:17 +000068}
69
andrew@webrtc.orga8b97372014-03-10 22:26:12 +000070int do_main(int argc, char* argv[]) {
andrew@webrtc.orgcb181212011-10-26 00:27:17 +000071 std::string program_name = argv[0];
72 std::string usage = "Commandline tool to unpack audioproc debug files.\n"
73 "Example usage:\n" + program_name + " debug_dump.pb\n";
andrew@webrtc.orgcb181212011-10-26 00:27:17 +000074
oprypin6e09d872017-08-31 03:21:39 -070075 if (rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true) ||
76 FLAG_help || argc < 2) {
77 printf("%s", usage.c_str());
78 if (FLAG_help) {
79 rtc::FlagList::Print(nullptr, false);
80 return 0;
81 }
andrew@webrtc.orgcb181212011-10-26 00:27:17 +000082 return 1;
83 }
84
andrew@webrtc.orga8b97372014-03-10 22:26:12 +000085 FILE* debug_file = OpenFile(argv[1], "rb");
andrew@webrtc.orgcd824382011-11-11 19:13:36 +000086
andrew@webrtc.orgcb181212011-10-26 00:27:17 +000087 Event event_msg;
andrew@webrtc.orgcd824382011-11-11 19:13:36 +000088 int frame_count = 0;
pkasting25702cb2016-01-08 13:50:27 -080089 size_t reverse_samples_per_channel = 0;
90 size_t input_samples_per_channel = 0;
91 size_t output_samples_per_channel = 0;
Peter Kasting69558702016-01-12 16:26:35 -080092 size_t num_reverse_channels = 0;
93 size_t num_input_channels = 0;
94 size_t num_output_channels = 0;
kwiberg62eaacf2016-02-17 06:39:05 -080095 std::unique_ptr<WavWriter> reverse_wav_file;
96 std::unique_ptr<WavWriter> input_wav_file;
97 std::unique_ptr<WavWriter> output_wav_file;
98 std::unique_ptr<RawFile> reverse_raw_file;
99 std::unique_ptr<RawFile> input_raw_file;
100 std::unique_ptr<RawFile> output_raw_file;
Minyue13b96ba2015-10-03 00:39:14 +0200101
oprypin6e09d872017-08-31 03:21:39 -0700102 FILE* settings_file = OpenFile(FLAG_settings_file, "wb");
Minyue13b96ba2015-10-03 00:39:14 +0200103
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000104 while (ReadMessageFromFile(debug_file, &event_msg)) {
andrew@webrtc.orgcb181212011-10-26 00:27:17 +0000105 if (event_msg.type() == Event::REVERSE_STREAM) {
106 if (!event_msg.has_reverse_stream()) {
andrew@webrtc.orga8b97372014-03-10 22:26:12 +0000107 printf("Corrupt input file: ReverseStream missing.\n");
andrew@webrtc.orgcb181212011-10-26 00:27:17 +0000108 return 1;
109 }
110
111 const ReverseStream msg = event_msg.reverse_stream();
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000112 if (msg.has_data()) {
oprypin6e09d872017-08-31 03:21:39 -0700113 if (FLAG_raw && !reverse_raw_file) {
114 reverse_raw_file.reset(new RawFile(std::string(FLAG_reverse_file) +
115 ".pcm"));
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +0000116 }
aluebs@webrtc.orgbac07262014-09-03 13:39:01 +0000117 // TODO(aluebs): Replace "num_reverse_channels *
118 // reverse_samples_per_channel" with "msg.data().size() /
119 // sizeof(int16_t)" and so on when this fix in audio_processing has made
120 // it into stable: https://webrtc-codereview.appspot.com/15299004/
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000121 WriteIntData(reinterpret_cast<const int16_t*>(msg.data().data()),
aluebs@webrtc.orgbac07262014-09-03 13:39:01 +0000122 num_reverse_channels * reverse_samples_per_channel,
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000123 reverse_wav_file.get(),
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +0000124 reverse_raw_file.get());
andrew@webrtc.orga8b97372014-03-10 22:26:12 +0000125 } else if (msg.channel_size() > 0) {
oprypin6e09d872017-08-31 03:21:39 -0700126 if (FLAG_raw && !reverse_raw_file) {
127 reverse_raw_file.reset(new RawFile(std::string(FLAG_reverse_file) +
128 ".float"));
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +0000129 }
kwiberg62eaacf2016-02-17 06:39:05 -0800130 std::unique_ptr<const float* []> data(
kwiberg@webrtc.org00b8f6b2015-02-26 14:34:55 +0000131 new const float* [num_reverse_channels]);
Peter Kasting69558702016-01-12 16:26:35 -0800132 for (size_t i = 0; i < num_reverse_channels; ++i) {
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000133 data[i] = reinterpret_cast<const float*>(msg.channel(i).data());
134 }
135 WriteFloatData(data.get(),
aluebs@webrtc.orgbac07262014-09-03 13:39:01 +0000136 reverse_samples_per_channel,
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000137 num_reverse_channels,
138 reverse_wav_file.get(),
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +0000139 reverse_raw_file.get());
andrew@webrtc.orgcb181212011-10-26 00:27:17 +0000140 }
141 } else if (event_msg.type() == Event::STREAM) {
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000142 frame_count++;
andrew@webrtc.orgcb181212011-10-26 00:27:17 +0000143 if (!event_msg.has_stream()) {
andrew@webrtc.orga8b97372014-03-10 22:26:12 +0000144 printf("Corrupt input file: Stream missing.\n");
andrew@webrtc.orgcb181212011-10-26 00:27:17 +0000145 return 1;
146 }
147
148 const Stream msg = event_msg.stream();
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000149 if (msg.has_input_data()) {
oprypin6e09d872017-08-31 03:21:39 -0700150 if (FLAG_raw && !input_raw_file) {
151 input_raw_file.reset(new RawFile(std::string(FLAG_input_file) +
152 ".pcm"));
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +0000153 }
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000154 WriteIntData(reinterpret_cast<const int16_t*>(msg.input_data().data()),
aluebs@webrtc.orgbac07262014-09-03 13:39:01 +0000155 num_input_channels * input_samples_per_channel,
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000156 input_wav_file.get(),
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +0000157 input_raw_file.get());
andrew@webrtc.orga8b97372014-03-10 22:26:12 +0000158 } else if (msg.input_channel_size() > 0) {
oprypin6e09d872017-08-31 03:21:39 -0700159 if (FLAG_raw && !input_raw_file) {
160 input_raw_file.reset(new RawFile(std::string(FLAG_input_file) +
161 ".float"));
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +0000162 }
kwiberg62eaacf2016-02-17 06:39:05 -0800163 std::unique_ptr<const float* []> data(
kwiberg@webrtc.org00b8f6b2015-02-26 14:34:55 +0000164 new const float* [num_input_channels]);
Peter Kasting69558702016-01-12 16:26:35 -0800165 for (size_t i = 0; i < num_input_channels; ++i) {
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000166 data[i] = reinterpret_cast<const float*>(msg.input_channel(i).data());
167 }
168 WriteFloatData(data.get(),
aluebs@webrtc.orgbac07262014-09-03 13:39:01 +0000169 input_samples_per_channel,
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000170 num_input_channels,
171 input_wav_file.get(),
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +0000172 input_raw_file.get());
andrew@webrtc.orgcb181212011-10-26 00:27:17 +0000173 }
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000174
175 if (msg.has_output_data()) {
oprypin6e09d872017-08-31 03:21:39 -0700176 if (FLAG_raw && !output_raw_file) {
177 output_raw_file.reset(new RawFile(std::string(FLAG_output_file) +
178 ".pcm"));
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +0000179 }
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000180 WriteIntData(reinterpret_cast<const int16_t*>(msg.output_data().data()),
aluebs@webrtc.orgbac07262014-09-03 13:39:01 +0000181 num_output_channels * output_samples_per_channel,
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000182 output_wav_file.get(),
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +0000183 output_raw_file.get());
andrew@webrtc.orga8b97372014-03-10 22:26:12 +0000184 } else if (msg.output_channel_size() > 0) {
oprypin6e09d872017-08-31 03:21:39 -0700185 if (FLAG_raw && !output_raw_file) {
186 output_raw_file.reset(new RawFile(std::string(FLAG_output_file) +
187 ".float"));
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +0000188 }
kwiberg62eaacf2016-02-17 06:39:05 -0800189 std::unique_ptr<const float* []> data(
kwiberg@webrtc.org00b8f6b2015-02-26 14:34:55 +0000190 new const float* [num_output_channels]);
Peter Kasting69558702016-01-12 16:26:35 -0800191 for (size_t i = 0; i < num_output_channels; ++i) {
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000192 data[i] =
193 reinterpret_cast<const float*>(msg.output_channel(i).data());
194 }
195 WriteFloatData(data.get(),
aluebs@webrtc.orgbac07262014-09-03 13:39:01 +0000196 output_samples_per_channel,
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000197 num_output_channels,
198 output_wav_file.get(),
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +0000199 output_raw_file.get());
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000200 }
201
oprypin6e09d872017-08-31 03:21:39 -0700202 if (FLAG_full) {
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000203 if (msg.has_delay()) {
oprypin6e09d872017-08-31 03:21:39 -0700204 static FILE* delay_file = OpenFile(FLAG_delay_file, "wb");
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000205 int32_t delay = msg.delay();
oprypin6e09d872017-08-31 03:21:39 -0700206 if (FLAG_text) {
Bjorn Volcker40a6d592015-05-06 10:51:34 +0200207 fprintf(delay_file, "%d\n", delay);
208 } else {
oprypin6e09d872017-08-31 03:21:39 -0700209 WriteData(&delay, sizeof(delay), delay_file, FLAG_delay_file);
Bjorn Volcker40a6d592015-05-06 10:51:34 +0200210 }
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000211 }
212
213 if (msg.has_drift()) {
oprypin6e09d872017-08-31 03:21:39 -0700214 static FILE* drift_file = OpenFile(FLAG_drift_file, "wb");
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000215 int32_t drift = msg.drift();
oprypin6e09d872017-08-31 03:21:39 -0700216 if (FLAG_text) {
Bjorn Volcker40a6d592015-05-06 10:51:34 +0200217 fprintf(drift_file, "%d\n", drift);
218 } else {
oprypin6e09d872017-08-31 03:21:39 -0700219 WriteData(&drift, sizeof(drift), drift_file, FLAG_drift_file);
Bjorn Volcker40a6d592015-05-06 10:51:34 +0200220 }
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000221 }
222
223 if (msg.has_level()) {
oprypin6e09d872017-08-31 03:21:39 -0700224 static FILE* level_file = OpenFile(FLAG_level_file, "wb");
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000225 int32_t level = msg.level();
oprypin6e09d872017-08-31 03:21:39 -0700226 if (FLAG_text) {
Bjorn Volcker40a6d592015-05-06 10:51:34 +0200227 fprintf(level_file, "%d\n", level);
228 } else {
oprypin6e09d872017-08-31 03:21:39 -0700229 WriteData(&level, sizeof(level), level_file, FLAG_level_file);
Bjorn Volcker40a6d592015-05-06 10:51:34 +0200230 }
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000231 }
andrew@webrtc.orgce8e0772014-02-12 15:28:30 +0000232
233 if (msg.has_keypress()) {
oprypin6e09d872017-08-31 03:21:39 -0700234 static FILE* keypress_file = OpenFile(FLAG_keypress_file, "wb");
andrew@webrtc.orgce8e0772014-02-12 15:28:30 +0000235 bool keypress = msg.keypress();
oprypin6e09d872017-08-31 03:21:39 -0700236 if (FLAG_text) {
Bjorn Volcker40a6d592015-05-06 10:51:34 +0200237 fprintf(keypress_file, "%d\n", keypress);
238 } else {
239 WriteData(&keypress, sizeof(keypress), keypress_file,
oprypin6e09d872017-08-31 03:21:39 -0700240 FLAG_keypress_file);
Bjorn Volcker40a6d592015-05-06 10:51:34 +0200241 }
andrew@webrtc.orgce8e0772014-02-12 15:28:30 +0000242 }
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000243 }
Minyue13b96ba2015-10-03 00:39:14 +0200244 } else if (event_msg.type() == Event::CONFIG) {
245 if (!event_msg.has_config()) {
246 printf("Corrupt input file: Config missing.\n");
247 return 1;
248 }
249 const audioproc::Config msg = event_msg.config();
250
251 fprintf(settings_file, "APM re-config at frame: %d\n", frame_count);
252
253 PRINT_CONFIG(aec_enabled);
254 PRINT_CONFIG(aec_delay_agnostic_enabled);
255 PRINT_CONFIG(aec_drift_compensation_enabled);
256 PRINT_CONFIG(aec_extended_filter_enabled);
257 PRINT_CONFIG(aec_suppression_level);
258 PRINT_CONFIG(aecm_enabled);
259 PRINT_CONFIG(aecm_comfort_noise_enabled);
260 PRINT_CONFIG(aecm_routing_mode);
261 PRINT_CONFIG(agc_enabled);
262 PRINT_CONFIG(agc_mode);
263 PRINT_CONFIG(agc_limiter_enabled);
264 PRINT_CONFIG(noise_robust_agc_enabled);
265 PRINT_CONFIG(hpf_enabled);
266 PRINT_CONFIG(ns_enabled);
267 PRINT_CONFIG(ns_level);
268 PRINT_CONFIG(transient_suppression_enabled);
Alejandro Luebsc9b0c262016-05-16 15:32:38 -0700269 PRINT_CONFIG(intelligibility_enhancer_enabled);
peah7789fe72016-04-15 01:19:44 -0700270 if (msg.has_experiments_description()) {
271 fprintf(settings_file, " experiments_description: %s\n",
272 msg.experiments_description().c_str());
273 }
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000274 } else if (event_msg.type() == Event::INIT) {
275 if (!event_msg.has_init()) {
andrew@webrtc.orga8b97372014-03-10 22:26:12 +0000276 printf("Corrupt input file: Init missing.\n");
andrew@webrtc.orgcb181212011-10-26 00:27:17 +0000277 return 1;
278 }
279
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000280 const Init msg = event_msg.init();
281 // These should print out zeros if they're missing.
282 fprintf(settings_file, "Init at frame: %d\n", frame_count);
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000283 int input_sample_rate = msg.sample_rate();
284 fprintf(settings_file, " Input sample rate: %d\n", input_sample_rate);
285 int output_sample_rate = msg.output_sample_rate();
286 fprintf(settings_file, " Output sample rate: %d\n", output_sample_rate);
287 int reverse_sample_rate = msg.reverse_sample_rate();
288 fprintf(settings_file,
289 " Reverse sample rate: %d\n",
290 reverse_sample_rate);
291 num_input_channels = msg.num_input_channels();
Peter Kasting69558702016-01-12 16:26:35 -0800292 fprintf(settings_file, " Input channels: %" PRIuS "\n",
293 num_input_channels);
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000294 num_output_channels = msg.num_output_channels();
Peter Kasting69558702016-01-12 16:26:35 -0800295 fprintf(settings_file, " Output channels: %" PRIuS "\n",
296 num_output_channels);
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000297 num_reverse_channels = msg.num_reverse_channels();
Peter Kasting69558702016-01-12 16:26:35 -0800298 fprintf(settings_file, " Reverse channels: %" PRIuS "\n",
299 num_reverse_channels);
andrew@webrtc.orgcd824382011-11-11 19:13:36 +0000300
301 fprintf(settings_file, "\n");
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000302
303 if (reverse_sample_rate == 0) {
304 reverse_sample_rate = input_sample_rate;
305 }
306 if (output_sample_rate == 0) {
307 output_sample_rate = input_sample_rate;
308 }
309
pkasting25702cb2016-01-08 13:50:27 -0800310 reverse_samples_per_channel =
311 static_cast<size_t>(reverse_sample_rate / 100);
312 input_samples_per_channel =
313 static_cast<size_t>(input_sample_rate / 100);
314 output_samples_per_channel =
315 static_cast<size_t>(output_sample_rate / 100);
aluebs@webrtc.orgbac07262014-09-03 13:39:01 +0000316
oprypin6e09d872017-08-31 03:21:39 -0700317 if (!FLAG_raw) {
aluebs@webrtc.org021e76f2014-09-04 18:12:00 +0000318 // The WAV files need to be reset every time, because they cant change
319 // their sample rate or number of channels.
aluebsf03a8d42016-06-17 09:41:41 -0700320 std::stringstream reverse_name;
oprypin6e09d872017-08-31 03:21:39 -0700321 reverse_name << FLAG_reverse_file << frame_count << ".wav";
aluebsf03a8d42016-06-17 09:41:41 -0700322 reverse_wav_file.reset(new WavWriter(reverse_name.str(),
andrew@webrtc.orga3ed7132014-10-31 21:51:03 +0000323 reverse_sample_rate,
324 num_reverse_channels));
aluebsf03a8d42016-06-17 09:41:41 -0700325 std::stringstream input_name;
oprypin6e09d872017-08-31 03:21:39 -0700326 input_name << FLAG_input_file << frame_count << ".wav";
aluebsf03a8d42016-06-17 09:41:41 -0700327 input_wav_file.reset(new WavWriter(input_name.str(),
andrew@webrtc.orga3ed7132014-10-31 21:51:03 +0000328 input_sample_rate,
329 num_input_channels));
aluebsf03a8d42016-06-17 09:41:41 -0700330 std::stringstream output_name;
oprypin6e09d872017-08-31 03:21:39 -0700331 output_name << FLAG_output_file << frame_count << ".wav";
aluebsf03a8d42016-06-17 09:41:41 -0700332 output_wav_file.reset(new WavWriter(output_name.str(),
andrew@webrtc.orga3ed7132014-10-31 21:51:03 +0000333 output_sample_rate,
334 num_output_channels));
aluebs@webrtc.org841f58f2014-09-02 07:51:51 +0000335 }
andrew@webrtc.orgcb181212011-10-26 00:27:17 +0000336 }
337 }
338
339 return 0;
340}
andrew@webrtc.orga8b97372014-03-10 22:26:12 +0000341
342} // namespace webrtc
343
344int main(int argc, char* argv[]) {
345 return webrtc::do_main(argc, argv);
346}