I am looking for a simple way of doing:
Code: Select all
if(getMicVol() > 127) {
printf("Blowing!");
}
Code: Select all
if(getMicVol() > 127) {
printf("Blowing!");
}
Code: Select all
static u8 oldsmp = 0;
register s8 smp_s = (*(char *)data) ^ 0x80;
register u8 smp = ((smp_s < 0) ? (-smp_s) : smp_s) << 1;
//return oldsmp = (oldsmp + smp) >> 1;
int vol = oldsmp = (oldsmp + smp) >> 1;
//printf("Vol: %d\n", oldsmp = (oldsmp + smp) >> 1);
if(vol > 200) printf("....\n");
else if(vol > 150) printf("...\n");
else if(vol > 100) printf("..\n");
else if(vol > 50) printf(".\n");
else printf(".\n");
Users browsing this forum: No registered users and 4 guests