iOS FLAC Playback

With the release of the iPhone 8 and iPhone X, Apple added support for FLAC playback. Kirk McElhearn wrote:

But I looked at the iPhone 7 tech specs, and it also says that it supports FLAC, so maybe Apple just means that the files can be read by third-party apps. If FLAC were natively supported on last year’s phone, a lot of people would have heard about it. I think that this has something to do with iOS 11. Because I looked on an older version of the iPhone 7 tech specs page (via the Wayback Machine), and FLAC support is not mentioned.

I maintain an app that plays back local files, and as of the initial release of iOS 11, I couldn’t find an API for facilitating playback of FLAC files. I asked on Stack Overflow; the question received a fair amount of traffic, but no clues.

The other day, I realized that my app is able to playback FLAC files with no changes to my code. It appears that, as of iOS 11.2, the isPlayable property of AVAsset returns true when backed by a FLAC file.

It’s nice to see that Apple has made this functionality available to third-party apps with no extra complexity.