Lines Matching refs:hdr

156 	struct wav_header hdr;  in wav_play()  local
163 if (read(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) { in wav_play()
168 hdr.num_channels, hdr.sample_rate, hdr.bits_per_sample, in wav_play()
169 hdr.audio_format == FORMAT_PCM ? "PCM" : "unknown"); in wav_play()
171 if ((hdr.riff_id != ID_RIFF) || in wav_play()
172 (hdr.riff_fmt != ID_WAVE) || in wav_play()
173 (hdr.fmt_id != ID_FMT)) { in wav_play()
177 if ((hdr.audio_format != FORMAT_PCM) || in wav_play()
178 (hdr.fmt_sz != 16)) { in wav_play()
182 if (hdr.bits_per_sample != 16) { in wav_play()
187 play_file(hdr.sample_rate, hdr.num_channels, in wav_play()
188 fd, hdr.data_sz); in wav_play()
195 struct wav_header hdr; in wav_rec() local
203 hdr.riff_id = ID_RIFF; in wav_rec()
204 hdr.riff_sz = 0; in wav_rec()
205 hdr.riff_fmt = ID_WAVE; in wav_rec()
206 hdr.fmt_id = ID_FMT; in wav_rec()
207 hdr.fmt_sz = 16; in wav_rec()
208 hdr.audio_format = FORMAT_PCM; in wav_rec()
209 hdr.num_channels = channels; in wav_rec()
210 hdr.sample_rate = rate; in wav_rec()
211 hdr.byte_rate = hdr.sample_rate * hdr.num_channels * 2; in wav_rec()
212 hdr.block_align = hdr.num_channels * 2; in wav_rec()
213 hdr.bits_per_sample = 16; in wav_rec()
214 hdr.data_id = ID_DATA; in wav_rec()
215 hdr.data_sz = 0; in wav_rec()
222 write(fd, &hdr, sizeof(hdr)); in wav_rec()
237 cfg.channel_count = hdr.num_channels; in wav_rec()
238 cfg.sample_rate = hdr.sample_rate; in wav_rec()
283 hdr.data_sz = total; in wav_rec()
284 hdr.riff_sz = total + 8 + 16 + 8; in wav_rec()
286 write(fd, &hdr, sizeof(hdr)); in wav_rec()