是否可以使用 AVAudioPCMBuffer 从视频文件中读取缓冲区?
let filePath: String = NSBundle.mainBundle().pathForResource("test", ofType: "mp4")!
println("\(filePath)")
let fileURL: NSURL = NSURL(fileURLWithPath: filePath)!
let audioFile = AVAudioFile(forReading: fileURL, error: nil)
let audioFormat = audioFile.processingFormat
let audioFrameCount = UInt32(audioFile.length)
let audioFileBuffer = AVAudioPCMBuffer(PCMFormat: audioFormat, frameCapacity: audioFrameCount)
audioFile.readIntoBuffer(audioFileBuffer, error: nil)
应用程序崩溃说“缓冲区的格式与播放器 swift 不匹配”