I have a an AUGraph made of entirely of Apple AudioUnits - DLSSynth, Delay, Stereo Mixer. I am trying to capture the output of this into an ExtAudioFile. My issue is that I think I need to convert from the AudioUnit format to a file format that ExtAudioFile can use. If I take the ASBD from the AUGraph, I get
mSampleRate Float64 44100
mFormatID UInt32 1819304813
mFormatFlags UInt32 41
mBytesPerPacket UInt32 4
mFramesPerPacket UInt32 1
mBytesPerFrame UInt32 4
mChannelsPerFrame UInt32 2
mBitsPerChannel UInt32 32
mReserved UInt32 0
But I can't create create an ExtAudioFile with that ASBD without getting a fmt? error. Can someone point in the right direction for recording this stream to a file?
You want to use that ASBD as your ExtAudioFile
's client format (kExtAudioFileProperty_ClientDataFormat
), set via property after file creation. This is the format of the data you pass in ExtAudioFileWrite
. The format of the output file is specified in ExtAudioFileOpen
.