summaryrefslogtreecommitdiff
path: root/bat/bat.c
diff options
context:
space:
mode:
Diffstat (limited to 'bat/bat.c')
-rw-r--r--bat/bat.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/bat/bat.c b/bat/bat.c
index 8645770..17d025d 100644
--- a/bat/bat.c
+++ b/bat/bat.c
@@ -331,6 +331,8 @@ _("Usage: alsabat [-options]...\n"
" --log=# file that both stdout and strerr redirecting to\n"
" --file=# file for playback\n"
" --saveplay=# file that storing playback content, for debug\n"
+" --readcapture=# file with previously captured content. File data\n"
+" is used for analysis instead of capturing it.\n"
" --local internal loop, set to bypass pcm hardware devices\n"
" --standalone standalone mode, to bypass analysis\n"
" --roundtriplatency round trip latency mode\n"
@@ -397,6 +399,7 @@ static void parse_arguments(struct bat *bat, int argc, char *argv[])
{"roundtriplatency", 0, 0, OPT_ROUNDTRIPLATENCY},
{"snr-db", 1, 0, OPT_SNRTHD_DB},
{"snr-pc", 1, 0, OPT_SNRTHD_PC},
+ {"readcapture", 1, 0, OPT_READCAPTURE},
{0, 0, 0, 0}
};
@@ -412,6 +415,11 @@ static void parse_arguments(struct bat *bat, int argc, char *argv[])
case OPT_SAVEPLAY:
bat->debugplay = optarg;
break;
+ case OPT_READCAPTURE:
+ bat->capturefile = optarg;
+ bat->capture.mode = MODE_ANALYZE_ONLY;
+ bat->playback.mode = MODE_ANALYZE_ONLY;
+ break;
case OPT_LOCAL:
bat->local = true;
break;
@@ -708,6 +716,15 @@ int main(int argc, char *argv[])
goto analyze;
}
+ if (bat.capture.mode == MODE_ANALYZE_ONLY && bat.capturefile) {
+ bat.capture.file = strdup(bat.capturefile);
+ fprintf(bat.log,
+ _("Using data from file %s for analysis\n"),
+ bat.capture.file);
+ fprintf(bat.log, _("Skipping playback and capture\n"));
+ goto analyze;
+ }
+
/* loopback thread: playback and capture in a loop */
if (bat.local == false)
test_loopback(&bat);