Use AVFoundation to change audio metadata

I am working on an application that should modify the metadata of audio files. I played with the official Apple AVReaderWriterOSX demo. I tried to set the metadata of AVAssetWriterInput and AVAssetWriter , but I still can't get it to work to write metadata to the output file. Does anyone have examples for this?

Thanks in advance.

+4
source share
1 answer

I think I found a solution. The easiest solution is to use AVAssetExportSession .

 AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetMediumQuality]; exportSession.outputURL = ...; exportSession.outputFileType = AVFileTypeQuickTimeMovie; exportSession.timeRange = CMTimeRangeMake(startTime, duration); exportSession.metadata = ...; [exportSession exportAsynchronouslyWithCompletionHandler:handlerBlock]; 
+5
source

Source: https://habr.com/ru/post/1386360/


All Articles