Casting a variable of type 'UnsafeMutableRawPointer' to UnsafeMutablePointer<> in Swift 3
<p>Starting with a class definition as follows: </p>

<pre><code>class Player {
    var playbackFile: AudioFileID? = nil
    var packetPosition: Int64 = 0
    var numPacketsToRead: UInt32 = 0
    var packetDescs: UnsafeMutablePointer&lt;AudioStreamPacketDescription&gt;? = nil
    var isDone = false
}
</code></pre>

<p>Then defining a callback function:</p>

<pre><code>let AQOutputCallback: AudioQueueOutputCallback = {(inUserData, inAQ, inCompleteAQBuffer) -&gt; () in
   let aqp = UnsafeMutablePointer&lt;Player&gt;(inUserData).pointee // this gives an error

// more code
}
</code></pre>

<p>This results in an error on the second line: "Cannot invoke initializer for type 'UnsafeMutablePointer' with an argument list of type 'UnsafeMutableRawPointer?'</p>

<p>How do I properly cast from type 'UnsafeMutableRawPointer?' to 'UnsafeMutablePointer' in Swift 3? </p>