From f5c8b03d78139ab03ce177e4e311f16fc5123a46 Mon Sep 17 00:00:00 2001 From: Harvie Date: Wed, 1 Aug 2012 05:23:04 +0200 Subject: [PATCH] Added parameter -d to set buffer size proportional to sample rate --- c/goertzel/goertzel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/c/goertzel/goertzel.c b/c/goertzel/goertzel.c index a269750..3dd5885 100644 --- a/c/goertzel/goertzel.c +++ b/c/goertzel/goertzel.c @@ -82,7 +82,7 @@ int main(int argc, char ** argv) { int freqs[argc+1]; freqs[0]=-1; int opt; - while ((opt = getopt(argc, argv, "?r:s:f:t:iqna")) != -1) { + while ((opt = getopt(argc, argv, "?d:r:s:f:t:iqna")) != -1) { switch (opt) { case 'r': samplerate = atoi(optarg); @@ -90,6 +90,9 @@ int main(int argc, char ** argv) { case 's': samplecount = atoi(optarg); break; + case 'd': + samplecount = samplerate/atoi(optarg); + break; case 'f': addfreq(freqs, atoi(optarg)); break; -- 2.30.2