Tag: ios7avassetexportsession

AVAssetExportSession失败 – 合并2个WAV文件(iOS7)

我试图合并2个WAV文件,使用AVAssetExportSession,在iOS7下。 我已经确认文件在那里,似乎并没有腐败或任何东西。 这些WAV文件是从设备本身的录制文件中提取的,而且是相对较小的文件。 调用exportAsync方法时,立即在完成块中立即出现“Operation Stopped”错误(原因描述为:“此操作不支持此介质”)。 这发生在模拟器和设备本身。 见下面我的导出代码: NSError *avError = nil; NSFileManager *fileManager = [NSFileManager defaultManager]; AVURLAsset *tmpAsset = [[AVURLAsset alloc] initWithURL:_tmpRecordingUrl options:@{AVURLAssetPreferPreciseDurationAndTimingKey: @YES}]; AVURLAsset *permAsset = [[AVURLAsset alloc] initWithURL:_url options:@{AVURLAssetPreferPreciseDurationAndTimingKey: @YES}]; AVMutableComposition *composition = [AVMutableComposition composition]; [composition insertTimeRange:CMTimeRangeMake(kCMTimeZero, permAsset.duration) ofAsset:permAsset atTime:kCMTimeZero error:&avError]; [composition insertTimeRange:CMTimeRangeMake(kCMTimeZero, tmpAsset.duration) ofAsset:tmpAsset atTime:CMTimeMakeWithSeconds(_positionSlider.value, 1) error:&avError]; AVAssetExportSession *export = [[AVAssetExportSession alloc] […]