AVAssetExportSession экспортирует mp3, сохраняя метаданные
Как мне экспортировать mp3 используя AVAssetExportSession
сохраняя теги id3? Можно ли редактировать теги id3 перед их экспортом?
Этот код пишет AVAsset
(myMp3Asset) в файл, но в полученном mp3 нет тега id3.
// myMp3Asset is an AVAsset
AVAssetExportSession *exportS = [[AVAssetExportSession alloc]
initWithAsset:myMp3Asset presetName:AVAssetExportPresetPassthrough];
exportS.outputFileType = @"com.apple.quicktime-movie";
NSString *path = [NSHomeDirectory() stringByAppendingFormat:@"/Documents/%@", @"song"];
exportS.outputURL = [NSURL fileURLWithPath:path];;
[exportS exportAsynchronouslyWithCompletionHandler:^{
if (exportS.status == AVAssetExportSessionStatusCompleted)
{
//then rename mov format to the original format.
NSFileManager *manage = [NSFileManager defaultManager];
NSString *mp3Path = [NSHomeDirectory() stringByAppendingFormat:@"/Documents/%@.%@", @"song", @".mp3"];
NSError *error = nil;
[manage moveItemAtPath:path toPath:mp3Path error:&error];
}
}];