if (stmp>1)
if (stmp>2)
int read_wav_header(FILE *file, int *rate, int *channels, int *format, int *size){   char ch[5];   int itmp;   short stmp;   int bpersec;   short balign;   ch[4]=0;   fread(ch, 1, 4, file);   if (strcmp(ch, "RIFF")!=0)   {      fseek(file, 0, SEEK_SET);      return 0;   }   fread(&itmp, 4, 1, file);   *size = le_int(itmp-36);   fread(ch, 1, 4, file);   if (strcmp(ch, "WAVE")!=0)   {      fprintf (stderr, "RIFF file is not a WAVE file\n");      return -1;   }   fread(ch, 1, 4, file);   if (strcmp(ch, "fmt ")!=0)   {      fprintf (stderr, "Corrupted WAVE file: no \"fmt \"\n");      return -1;   }      fread(&itmp, 4, 1, file);   itmp = le_int(itmp);   if (itmp!=16)   {      fprintf (stderr, "Unsupported WAVE file fmt chunk, not PCM?\n");      return -1;   }   fread(&stmp, 2, 1, file);   stmp = le_short(stmp);   if (stmp!=1)   {      fprintf (stderr, "Only PCM encoding is supported\n");      return -1;   }   fread(&stmp, 2, 1, file);   stmp = le_short(stmp);   *channels = stmp;      if (stmp>1)   {      fprintf (stderr, "Only mono supported for now\n");      return -1;   }   fread(&itmp, 4, 1, file);   itmp = le_int(itmp);   *rate = itmp;   if (*rate != 8000 && *rate != 16000 && *rate != 11025 && *rate != 22050 && *rate != 32000 && *rate != 44100 && *rate != 48000)   {      fprintf (stderr, "Only 8 kHz (narrowband) and 16 kHz (wideband) supported (plus 11.025 kHz and 22.05 kHz, but your mileage may vary)\n");      return -1;   }   fread(&itmp, 4, 1, file);   bpersec = le_int(itmp);   fread(&stmp, 2, 1, file);   balign = le_short(stmp);   fread(&stmp, 2, 1, file);   stmp = le_short(stmp);   if (stmp!=16 && stmp!=8)   {      fprintf (stderr, "Only 8/16-bit linear supported\n");      return -1;   }   *format=stmp;   if (bpersec!=*rate**channels*stmp/8)   {      fprintf (stderr, "Corrupted header: ByteRate mismatch\n");      return -1;   }   if (balign!=*channels*stmp/8)   {      fprintf (stderr, "Corrupted header: BlockAlign mismatch\n");      return -1;   }   fread(ch, 1, 4, file);   if (strcmp(ch, "data")!=0)   {      fprintf (stderr, "Corrupted WAVE file: no \"data\"\n");      return -1;   }   /*Ignore this for now*/   fread(&itmp, 4, 1, file);   itmp = le_int(itmp);   return 1;}