开发者

convert ExtAudioFileRef type to AudioFileID type in iOS

开发者 https://www.devze.com 2023-02-09 09:21 出处:网络
I\'ve been using ExtAudioFile Services and I want to use an AudioFile Service which requires开发者_C百科 an AudioFileID parameter. This parameter corresponds to ExtAudioFileRef used in ExtAudioFile Se

I've been using ExtAudioFile Services and I want to use an AudioFile Service which requires开发者_C百科 an AudioFileID parameter. This parameter corresponds to ExtAudioFileRef used in ExtAudioFile Services. How do I convert from ExtAudioFileRef type to AudioFileID type?


I know this one is old and answered, but I just noticed it and thought I'll leave a correct answer here for future reference

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


Just typecast it, it works fine! AudioFileID audiofile = (AudioFileID)AudioExt where AudioExt is of type ExtAudioFileRef

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号