Prior to iOS 17, I used AVAudioFile
to open (for reading) the assetURL
of MPMediaItem
for songs that the user purchased through iTunes Store. With the iOS 17 Beta, this seems no longer possible as AVAudioFile throws this:
ExtAudioFile.cpp:211 about to throw -54: open audio file
AVAEInternal.h:109 [AVAudioFile.mm:135:AVAudioFileImpl: (ExtAudioFileOpenURL((CFURLRef)fileURL, &_extAudioFile)): error -54
Also can't copy the url to Documents directory because I get this:
The file “item.m4a” couldn’t be opened because URL type ipod-library isn’t supported.
This seems to be affecting other apps on the App Store besides mine, and it will reflect very badly on my app if this makes into the final iOS 17 because I have encouraged users to buy songs on iTunes Store to use with my app. Now there seems like there is no way to access them.
Is this a known bug, or is there some type of workaround?