fprintf (stderr, "Only 16-bit PCM supported\n");
fprintf (stderr, "Unsupported WAVE file fmt chunk, not PCM?\n");
int read_wav_header(FILE *file, int *rate, int *channels, int *format, int *size){   char ch[5];   int itmp;   short stmp;   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, "Only 16-bit PCM supported\n");      return -1;   }   fread(&stmp, 2, 1, file);   stmp = le_short(stmp);   if (stmp!=1)   {      fprintf (stderr, "Only 16-bit PCM supported\n");      return -1;   }   fread(&stmp, 2, 1, file);   stmp = le_short(stmp);   *channels = stmp;   fread(&itmp, 4, 1, file);   itmp = le_int(itmp);   *rate = itmp;   fread(&itmp, 4, 1, file);   itmp = le_int(itmp);   if (itmp!=*rate**channels*2)   {      fprintf (stderr, "Corrupted header: ByteRate mismatch\n");      return -1;   }   fread(&stmp, 2, 1, file);   stmp = le_short(stmp);   if (stmp!=*channels*2)   {      fprintf (stderr, "Corrupted header: BlockAlign mismatch\n");      return -1;   }   fread(&stmp, 2, 1, file);   stmp = le_short(stmp);   if (stmp!=16)   {      fprintf (stderr, "Only 16-bit linear supported\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);   *format=16;   return 1;}