【发布时间】:2017-08-19 17:23:25
【问题描述】:
Domain=AVFoundationErrorDomain Code=-11838 \"Operation Stopped\" UserInfo={NSLocalizedDescription=Operation Stopped, NSLocalizedFailureReason=此媒体不支持该操作。})")
{来源:caf lpcm,目的地:aiff or wav or caf}
代码如下:
let composition = AVMutableComposition()
self.prepareToCombineMedia(composition)
let exportSession = AVAssetExportSession(asset: composition, presetName: AVAssetExportPresetPassthrough)!
let tmpFilePath = FileUtils.tempFile(ext: "caf")
exportSession.outputURL = NSURL.fileURL(withPath: tmpFilePath)
exportSession.outputFileType = AVFileTypeCoreAudioFormat
exportSession.exportAsynchronously {
if exportSession.status == .completed {
print("completed")
print(tmpFilePath)
subscriber.onCompleted()
} else {
subscriber.onError(LeafError.runtime(message: exportSession.error.debugDescription))
FileUtils.rm(tmpFilePath)
}
}
它只能合并到 m4a 或 mov。我需要 caf 或 wav 或 aiff 文件,帮助...
【问题讨论】:
标签: ios swift avfoundation avassetexportsession