Lines Matching refs:wav

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