tresh=10
last='';
-./goertzel -i -q -a -r 8000 -s 400 -t $tresh -f 697 -f 770 -f 852 -f 941 -f 1209 -f 1336 -f 1477 -f 1633 $@ | while read line; do
+./goertzel -n -q -l -r 8000 -d 20 -t $tresh -f 697 -f 770 -f 852 -f 941 -f 1209 -f 1336 -f 1477 -f 1633 $@ | while read line; do
#echo "$line";
#Get time
int freqs[argc+1]; freqs[0]=-1;
int opt;
- while ((opt = getopt(argc, argv, "?d:r:s:f:t:iqna")) != -1) {
+ while ((opt = getopt(argc, argv, "?i:o:a:r:c:d:f:t:nlbq")) != -1) {
switch (opt) {
+ case 'i':
+ freopen(optarg, "r", stdin);
+ break;
+ case 'o':
+ freopen(optarg, "w", stdout);
+ break;
+ case 'a':
+ freopen(optarg, "a", stdout);
+ break;
case 'r':
samplerate = atoi(optarg);
break;
- case 's':
+ case 'c':
samplecount = atoi(optarg);
break;
case 'd':
case 't':
treshold = atoi(optarg);
break;
- case 'i':
+ case 'n':
integers = 1;
break;
- case 'a':
+ case 'l':
repeat = 0;
break;
- case 'n':
+ case 'b':
noreturn = 1;
break;
case 'q':
while getopts "s" OPT; do
test "$OPT" == 's' && screen=true;
done
-arecord | ./goertzel -i -q -a -t $tresh -s 2000 | while read line; do
+arecord | ./goertzel -n -q -l -t $tresh -d 4 | while read line; do
date="$(date +%s)"
time="$(echo "$line" | cut -f 1)"
level="$(echo "$line" | cut -f 2)"