Convert ExtAudioFileRef type to AudioFileID type in iOS

I am using ExtAudioFile services and I want to use an AudioFile service that requires the AudioFileID parameter. This parameter corresponds to the ExtAudioFileRef used in ExtAudioFile services. How to convert from type ExtAudioFileRef to type AudioFileID?

+5
source share
2 answers

Just make it up, it works great! AudioFileID audiofile = (AudioFileID)AudioExt where AudioExt is of type ExtAudioFileRef

-3
source

I know this old one also answered, but I just noticed it and thought that I would leave the correct answer here for future reference

AudioFileID audioFile;
UInt32 dataSize = sizeof(AudioFileID);
ExtAudioFileGetProperty(extAudioFile, kExtAudioFileProperty_AudioFile, &dataSize, &audioFile);
+8
source

All Articles