Search code examples
ioscore-audioaudiounit

What is the difference between AudioFileOpenURL and ExtAudioFileOpenURL?


If I use ExtAudioFile in conjunction with a remoteIO audio unit, I can use ExtAudioFileSetProperty with kExtAudioFileProperty_ClientDataFormat to convert the audio format read from disk into a device native format (with canonical au tags).

It seems when I use AudioFileOpenURL and related methods I can't use AudioFileSetProperty with kAudioFilePropertyDataFormat in the same way.

Why can't I convert any audio file to the client data format through this slightly higher level api?


Solution

  • The AudioFile API came first, and is the lower-level of the two. ExtAudioFile is essentially a wrapper around an AudioFile and an associated AudioConverter. It is ExtAudioFile's internal AudioConverter that provides the functionality to convert to a specific client format.