1

So a .wav file has a few standard chunks. In most of the files I work with, the "RIFF" chunk is first, then a "fmt " chunk, then the "DATA" chunk. When recording using AVAudioRecorder, those chunks are created (although an extra "FLLR" is created before the "DATA" chunk.)

When creating a file with AudioQueue, those standard chunks aren't created. Instead, AudioQueue creates, in order, "caff","desc","lpcm","free", and "data" chunks.

What's going on? Aren't the "RIFF" and "fmt " chunks required? How does one force the inclusion of those chunks?

I'm creating a file by:

AudioFileCreateWithURL(URL, kAudioFileCAFType, &inputDataFormat, kAudioFileFlags_EraseFile, &AudioFile);

with inputDataFormat being a AudioStreamBasicDescription with a full complement of properties.

So how does one write, at least, the "RIFF" and "fmt " chunks with AudioQueue?

Thanks.

Eric Christensen
  • 819
  • 3
  • 9
  • 21

1 Answers1

1

So a .wav file has a few standard chunks. …

When creating a file with AudioQueue, those standard chunks aren't created. …

I'm creating a file by:

AudioFileCreateWithURL(URL, kAudioFileCAFType, &inputDataFormat, kAudioFileFlags_EraseFile, &AudioFile);

Let this be an example of the value of showing one's code in one's question. :-)

kAudioFileCAFType is a Core Audio File, not a WAV file. Try kAudioFileWAVEType instead.

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370