Target : ipod library -> aiff / wav / caf (which eat by libsndfile (already ported to ios))
first, i think AVAssetExportSession can solve my problem due to this link:
but it is for converted-to-mp3 only (or converted-to-m4a)
Some points you need notice:
when you init AVAssetExportSession object, the “presetName” argument must be “AVAssetExportPresetPassthrough”.
The “outputFileType” may be “com.apple.quicktime-movie”.
And rename to mp3)
why i know it is for mov or m4a
if u write :
NSLog(@”export.supportedFileTypes : %@”,export.supportedFileTypes);
u will get:
exporter.supportedFileTypes : (
but it is only telling u these type exporter can convert
Not all presets are compatible with all assets.
So after i run
NSLog(@”%@”, [AVAssetExportSession exportPresetsCompatibleWithAsset:songAsset]);
2014-05-27 18:29:35.792 Jtab[1723:60b] (
only m4a is available (and mp3 using mov one)
whatever your ipod library song is mp3, m4a, wav (i tried)
so it is fail
And note that using AVAssetExportSession, the output extension is concerned, if type != extension will error
So i go to other solution AVAssetWriter:
Easy AAC compressed audio conversion on iOS
But i think use AVAssetExportSession to m4a can solve the problem…,so TPAACAudioConverter is useless now