Beermeter
[mirrors/Programs.git] / c / beermeter / audio.c
1 #include <stdio.h>
2
3 #define SAMPLE_MIN -128
4 #define SAMPLE_MAX 127
5
6 int main() {
7 unsigned long count=0;
8 char sample, sample_last=SAMPLE_MIN, x=0, y=0;
9 while(!feof(stdin)) {
10 fread(&sample,1,1,stdin);
11 if(
12 (sample_last < 0 && sample > SAMPLE_MAX/2)
13 || (sample_last >= 0 && sample < SAMPLE_MIN/2)
14 )
15 {
16 putchar('.');
17 //printf("\r%lu ", ++count);
18 fflush(stdout);
19 sample_last=sample;
20 }
21 }
22 }
This page took 0.233918 seconds and 4 git commands to generate.