Lines Matching defs:wav
67 return (gettext("Unable to read wav header"));
69 return (gettext("Unsupported wav format"));
71 return (gettext("Bad wav header"));
186 Wave_filehdr wav;
189 (void) memset(&wav, 0, sizeof (wav));
192 if (read(h->bstr_fd, &wav, sizeof (wav)) != sizeof (wav)) {
195 wav.total_chunk_size = CPU_TO_LE32(sz - 8);
196 wav.data_size = CPU_TO_LE32(sz - 44);
198 if (write(h->bstr_fd, &wav, sizeof (wav)) != sizeof (wav)) {
471 Wave_filehdr *wav;
475 wav = NULL;
488 wav = (Wave_filehdr *)my_zalloc(sizeof (*wav));
489 if (read(fd, wav, sizeof (*wav)) != sizeof (*wav)) {
493 if ((strncmp(wav->riff, "RIFF", 4) != 0) ||
494 (strncmp(wav->wave, "WAVE", 4) != 0)) {
498 if (((CPU_TO_LE32(wav->total_chunk_size) + 8) != st.st_size) ||
499 (strncmp(wav->fmt, "fmt ", 4) != 0) ||
500 (CPU_TO_LE16(wav->fmt_tag) != 1) ||
501 (CPU_TO_LE16(wav->n_channels) != 2) ||
502 (CPU_TO_LE32(wav->sample_rate) != 44100) ||
503 (CPU_TO_LE16(wav->bits_per_sample) != 16) ||
504 (strncmp(wav->data, "data", 4) != 0) ||
505 ((CPU_TO_LE32(wav->data_size) + 44) != st.st_size)) {
510 data_size = CPU_TO_LE32(wav->data_size);
511 if (lseek(fd, sizeof (*wav), SEEK_SET) < 0) {
515 free(wav);
529 if (wav != NULL)
530 free(wav);