Lines Matching refs:hdr
153 struct wav_header hdr;
161 if (read(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) {
166 hdr.num_channels, hdr.sample_rate, hdr.bits_per_sample,
167 hdr.audio_format == FORMAT_PCM ? "PCM" : "unknown");
169 if ((hdr.riff_id != ID_RIFF) ||
170 (hdr.riff_fmt != ID_WAVE) ||
171 (hdr.fmt_id != ID_FMT)) {
175 if ((hdr.audio_format != FORMAT_PCM) ||
176 (hdr.fmt_sz != 16)) {
180 if (hdr.bits_per_sample != 16) {
185 play_file(hdr.sample_rate, hdr.num_channels,
186 fd, hdr.data_sz);
193 struct wav_header hdr;
201 hdr.riff_id = ID_RIFF;
202 hdr.riff_sz = 0;
203 hdr.riff_fmt = ID_WAVE;
204 hdr.fmt_id = ID_FMT;
205 hdr.fmt_sz = 16;
206 hdr.audio_format = FORMAT_PCM;
207 hdr.num_channels = channels;
208 hdr.sample_rate = rate;
209 hdr.byte_rate = hdr.sample_rate * hdr.num_channels * 2;
210 hdr.block_align = hdr.num_channels * 2;
211 hdr.bits_per_sample = 16;
212 hdr.data_id = ID_DATA;
213 hdr.data_sz = 0;
220 write(fd, &hdr, sizeof(hdr));
235 cfg.channel_count = hdr.num_channels;
236 cfg.sample_rate = hdr.sample_rate;
281 hdr.data_sz = total;
282 hdr.riff_sz = total + 8 + 16 + 8;
284 write(fd, &hdr, sizeof(hdr));