14
Dec
10

iPod Library Sampling

So you want to play with audio from the user’s iPod library? You good with requiring 4.1 for your app? Then you should read

From iPod Library to PCM Samples in Far Fewer Steps Than Were Previously Necessary

iOS 4.1 added a number of new classes to AV Foundation (indeed, these were among the most significant 4.1 API diffs) to provide an API for sample-level access to media. The essential classes are AVAssetReader and AVAssetWriter. Using these, we can dramatically simplify and improve the iPod converter.

I have an example project, VTM_AViPodReader.zip (70 KB) …

The ‘previously necessary steps’, in case you’d missed those too, were

In a July blog entry, I showed a gruesome technique for getting raw PCM samples of audio from your iPod library, by means of an easily-overlooked metadata attribute in the Media Library framework, along with the export functionality of AV Foundation. The AV Foundation stuff was the gruesome part — with no direct means for sample-level access to the song “asset”, it required an intermedia export to .m4a, which was a lossy re-encode if the source was of a different format (like MP3), and then a subsequent conversion to PCM with Core Audio…

Yes, that’s quite the process so it is. Meriting that post’s title,

From iPhone Media Library to PCM Samples in Dozens of Confounding, Potentially Lossy Steps

indeed. But hey, if you absolutely have to support anything besides the latest and greatest, then you’ll need to know that too!


0 Responses to “iPod Library Sampling”


  1. No Comments

Leave a Reply