What is the UTI (Uniform Type Identifier) of an AAC audio file on iOS?

1.1k views Asked by At

I need to know what the Uniform Type Identifier is for an AAC audio file.

Context: I'm building an audio player app that plays DRM'd AAC files using HLS. I want to support offline playback, but I don't want to use AVFoundation's offline stuff (via AVAssetDownloadTask) because it'll delete the files out from under me when it needs to reclaim disk space (according to this WWDC 2016 session). So I'm downloading the files myself and using AVAssetResourceLoaderDelegate (walkthrough here) to serve files from the disk instead of the network when I want to. But the player just buffers forever. I tried serving a plain, unecrypted AAC file with no HLS involvement, and it failed the same way. I tried a plain, unencrypted MP3 file, and it worked. I changed the UTI provided to loadingRequest.contentInformationRequest.contentType in resourceLoader:shouldWaitForLoadingOfRequestedResource: from the correct audio.mp3 to audio.aac and it failed the same way. From this I infer that what I need is the correct UTI for an AAC file.

Update: Interestingly, public.aifc-audio and public.aac-audio work to play an unencrypted AAC audio file, but not the encrypted one with HLS involved.

0

There are 0 answers