withAudioUnit(_:)
Provides scoped access to the I/O node’s AudioUnit
Declaration
func withAudioUnit<R, E>(_ body: (borrowing AudioUnit?) throws(E) -> R) throws(E) -> R where E : ErrorParameters
- body:
A closure that receives the AudioUnit instance
Return Value
The value returned by the closure
Discussion
This method provides thread-safe, scoped access to the underlying AudioUnit. The audio unit reference is only valid within the closure and must not be retained or accessed outside of it.