aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/audio_processing/test
diff options
context:
space:
mode:
authorBjorn Volcker <bjornv@webrtc.org>2015-05-06 10:51:34 +0200
committerBjorn Volcker <bjornv@webrtc.org>2015-05-06 08:51:47 +0000
commit40a6d593d26cb87421ab40c3a7ec023f6501721c (patch)
tree1bc032855c03ea6e22f10b52e3ca81a17f0e6a5f /webrtc/modules/audio_processing/test
parent9695d8523b1cea873e778d3035082be08ccfa145 (diff)
downloadwebrtc-40a6d593d26cb87421ab40c3a7ec023f6501721c.tar.gz
audio_processing/tests: Adds a flag to unpack input data to text file
For quick and easy aecdump verifiation storing data as text speeds up the issue tracking process, since anyone can simply view values like mic volume. BUG=4609 TESTED=verified unpacking an aecdump with flag --txt stores that data in text files R=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/50849004 Cr-Commit-Position: refs/heads/master@{#9142}
Diffstat (limited to 'webrtc/modules/audio_processing/test')
-rw-r--r--webrtc/modules/audio_processing/test/unpack.cc29
1 files changed, 24 insertions, 5 deletions
diff --git a/webrtc/modules/audio_processing/test/unpack.cc b/webrtc/modules/audio_processing/test/unpack.cc
index af0f5cae89..49c8b3c979 100644
--- a/webrtc/modules/audio_processing/test/unpack.cc
+++ b/webrtc/modules/audio_processing/test/unpack.cc
@@ -35,6 +35,9 @@ DEFINE_string(settings_file, "settings.txt", "The name of the settings file.");
DEFINE_bool(full, false,
"Unpack the full set of files (normally not needed).");
DEFINE_bool(raw, false, "Write raw data instead of a WAV file.");
+DEFINE_bool(text,
+ false,
+ "Write non-audio files as text files instead of binary files.");
namespace webrtc {
@@ -175,26 +178,42 @@ int do_main(int argc, char* argv[]) {
if (msg.has_delay()) {
static FILE* delay_file = OpenFile(FLAGS_delay_file, "wb");
int32_t delay = msg.delay();
- WriteData(&delay, sizeof(delay), delay_file, FLAGS_delay_file);
+ if (FLAGS_text) {
+ fprintf(delay_file, "%d\n", delay);
+ } else {
+ WriteData(&delay, sizeof(delay), delay_file, FLAGS_delay_file);
+ }
}
if (msg.has_drift()) {
static FILE* drift_file = OpenFile(FLAGS_drift_file, "wb");
int32_t drift = msg.drift();
- WriteData(&drift, sizeof(drift), drift_file, FLAGS_drift_file);
+ if (FLAGS_text) {
+ fprintf(drift_file, "%d\n", drift);
+ } else {
+ WriteData(&drift, sizeof(drift), drift_file, FLAGS_drift_file);
+ }
}
if (msg.has_level()) {
static FILE* level_file = OpenFile(FLAGS_level_file, "wb");
int32_t level = msg.level();
- WriteData(&level, sizeof(level), level_file, FLAGS_level_file);
+ if (FLAGS_text) {
+ fprintf(level_file, "%d\n", level);
+ } else {
+ WriteData(&level, sizeof(level), level_file, FLAGS_level_file);
+ }
}
if (msg.has_keypress()) {
static FILE* keypress_file = OpenFile(FLAGS_keypress_file, "wb");
bool keypress = msg.keypress();
- WriteData(&keypress, sizeof(keypress), keypress_file,
- FLAGS_keypress_file);
+ if (FLAGS_text) {
+ fprintf(keypress_file, "%d\n", keypress);
+ } else {
+ WriteData(&keypress, sizeof(keypress), keypress_file,
+ FLAGS_keypress_file);
+ }
}
}
} else if (event_msg.type() == Event::INIT) {