I’m grabbing song data from the iOS music library (as an NSData object), but when the data is not that of an MP3 file, I’d like to transcode it.
I have two questions about the transcoding process:
-
Is there something built in to do, say M4A to MP3 transcoding, or will I have to use something like ffmpeg or other external libraries? If the latter, are there any examples of doing this on iOS knocking about?
-
What’s the best way to do this that doesn’t load everything into memory? Obviously a large song file will exhaust the memory and the app will be terminated.
maybe libSOX fits to your needs.the features of the tool are available [here][2]
to compile for iOS, check out the thread building libsox for iOS question
[2]: http://sox.sourceforge.net/Docs/Features “here”
i think ffmpeg is the choice
for iOS http://code.google.com/p/ffmpeg4iphone/
http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-October/076618.html
http://fobs.sourceforge.net/ is another choice (C++ wrapper to FFMPEG). Its home page has a reference to m4a files. To use it you could wrap up C++ in Objective-C in a .mm file.