Lines Matching refs:header
42 ChunkHeader header; member
51 ChunkHeader header; member
66 ChunkHeader header; member
86 ChunkHeader header; member
99 ChunkHeader header; member
103 ChunkHeader header; member
184 const uint32_t fmt_size = fmt_subchunk->header.Size; in ReadFmtChunkData()
208 auto header = rtc::MsanUninitialized<WavHeaderPcm>({}); in WritePcmWavHeader() local
211 header.riff.header.ID = PackFourCC('R', 'I', 'F', 'F'); in WritePcmWavHeader()
212 header.riff.header.Size = RiffChunkSize(bytes_in_payload, *header_size); in WritePcmWavHeader()
213 header.riff.Format = PackFourCC('W', 'A', 'V', 'E'); in WritePcmWavHeader()
214 header.fmt.header.ID = PackFourCC('f', 'm', 't', ' '); in WritePcmWavHeader()
215 header.fmt.header.Size = kFmtPcmSubchunkSize; in WritePcmWavHeader()
216 header.fmt.AudioFormat = MapWavFormatToHeaderField(WavFormat::kWavFormatPcm); in WritePcmWavHeader()
217 header.fmt.NumChannels = static_cast<uint16_t>(num_channels); in WritePcmWavHeader()
218 header.fmt.SampleRate = sample_rate; in WritePcmWavHeader()
219 header.fmt.ByteRate = ByteRate(num_channels, sample_rate, bytes_per_sample); in WritePcmWavHeader()
220 header.fmt.BlockAlign = BlockAlign(num_channels, bytes_per_sample); in WritePcmWavHeader()
221 header.fmt.BitsPerSample = static_cast<uint16_t>(8 * bytes_per_sample); in WritePcmWavHeader()
222 header.data.header.ID = PackFourCC('d', 'a', 't', 'a'); in WritePcmWavHeader()
223 header.data.header.Size = static_cast<uint32_t>(bytes_in_payload); in WritePcmWavHeader()
227 memcpy(buf, &header, *header_size); in WritePcmWavHeader()
239 auto header = rtc::MsanUninitialized<WavHeaderIeeeFloat>({}); in WriteIeeeFloatWavHeader() local
242 header.riff.header.ID = PackFourCC('R', 'I', 'F', 'F'); in WriteIeeeFloatWavHeader()
243 header.riff.header.Size = RiffChunkSize(bytes_in_payload, *header_size); in WriteIeeeFloatWavHeader()
244 header.riff.Format = PackFourCC('W', 'A', 'V', 'E'); in WriteIeeeFloatWavHeader()
245 header.fmt.header.ID = PackFourCC('f', 'm', 't', ' '); in WriteIeeeFloatWavHeader()
246 header.fmt.header.Size = kFmtIeeeFloatSubchunkSize; in WriteIeeeFloatWavHeader()
247 header.fmt.AudioFormat = in WriteIeeeFloatWavHeader()
249 header.fmt.NumChannels = static_cast<uint16_t>(num_channels); in WriteIeeeFloatWavHeader()
250 header.fmt.SampleRate = sample_rate; in WriteIeeeFloatWavHeader()
251 header.fmt.ByteRate = ByteRate(num_channels, sample_rate, bytes_per_sample); in WriteIeeeFloatWavHeader()
252 header.fmt.BlockAlign = BlockAlign(num_channels, bytes_per_sample); in WriteIeeeFloatWavHeader()
253 header.fmt.BitsPerSample = static_cast<uint16_t>(8 * bytes_per_sample); in WriteIeeeFloatWavHeader()
254 header.fmt.ExtensionSize = 0; in WriteIeeeFloatWavHeader()
255 header.fact.header.ID = PackFourCC('f', 'a', 'c', 't'); in WriteIeeeFloatWavHeader()
256 header.fact.header.Size = 4; in WriteIeeeFloatWavHeader()
257 header.fact.SampleLength = static_cast<uint32_t>(num_channels * num_samples); in WriteIeeeFloatWavHeader()
258 header.data.header.ID = PackFourCC('d', 'a', 't', 'a'); in WriteIeeeFloatWavHeader()
259 header.data.header.Size = static_cast<uint32_t>(bytes_in_payload); in WriteIeeeFloatWavHeader()
263 memcpy(buf, &header, *header_size); in WriteIeeeFloatWavHeader()
377 auto header = rtc::MsanUninitialized<WavHeaderPcm>({}); in ReadWavHeader() local
380 if (readable->Read(&header.riff, sizeof(header.riff)) != sizeof(header.riff)) in ReadWavHeader()
382 if (ReadFourCC(header.riff.header.ID) != "RIFF") in ReadWavHeader()
384 if (ReadFourCC(header.riff.Format) != "WAVE") in ReadWavHeader()
391 if (!FindWaveChunk(&header.fmt.header, readable, "fmt ")) { in ReadWavHeader()
395 if (!ReadFmtChunkData(&header.fmt, readable)) { in ReadWavHeader()
399 if (!FindWaveChunk(&header.data.header, readable, "data")) { in ReadWavHeader()
405 *format = MapHeaderFieldToWavFormat(header.fmt.AudioFormat); in ReadWavHeader()
406 *num_channels = header.fmt.NumChannels; in ReadWavHeader()
407 *sample_rate = header.fmt.SampleRate; in ReadWavHeader()
408 *bytes_per_sample = header.fmt.BitsPerSample / 8; in ReadWavHeader()
409 const size_t bytes_in_payload = header.data.header.Size; in ReadWavHeader()
418 if (header.riff.header.Size < RiffChunkSize(bytes_in_payload, header_size)) in ReadWavHeader()
420 if (header.fmt.ByteRate != in ReadWavHeader()
423 if (header.fmt.BlockAlign != BlockAlign(*num_channels, *bytes_per_sample)) in ReadWavHeader()