1

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?

olynoise
  • 2,016
  • 2
  • 19
  • 32
  • I've not used nearly that many AUs but I've typically not needed to specify an ASBD for the audio file. What happens when you call ExtAudioFileWriteAsync without setting an ASBD on the file? What kind of error do you get? Also, what data and file formats are trying to write? – Nick Jul 11 '13 at 13:39

1 Answers1

2

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.

sbooth
  • 16,646
  • 2
  • 55
  • 81