私は愚かで明らかに単純な問題で本当に夢中になっています...私は aData
を に変換する必要がありAVAudioPCMBuffer
ます。
この質問を見ると簡単そうに見えますが、Swift 3 ですべてが変わりました。この呪われた言語は絶えず変化しています (突発してすみません)!
このコードスニペットがあります
let audioBuffer = AVAudioPCMBuffer(pcmFormat: audioFormat!, frameCapacity: UInt32(data.count)/(audioFormat?.streamDescription.pointee.mBytesPerFrame)!)
audioBuffer.frameLength = audioBuffer.frameCapacity
let channels = UnsafeBufferPointer(start: audioBuffer.floatChannelData, count: Int(audioFormat!.channelCount))
data.copyBytes(to: UnsafeMutablePointer<Float>(channels[0]))
しかし、この最後の行は私にこのエラーを与えます:
Cannot convert value of type 'UnsafeMutablePointer<Float>' to expected
argument type 'UnsafeMutablePointer<_>'
誰かがこれを解決できますか?