func withUnsafeAudioBufferList<R>(_ body: (UnsafePointer<AudioBufferList>) throws -> R) rethrows -> R
Provides scoped read-only access to the audio buffer list.
- Warning: Although the `AudioBufferList` pointer is const, each `AudioBuffer` within
the list exposes `mData` as `UnsafeMutableRawPointer`. You must not modify the buffer
data through these pointers. Doing so results in undefined behavior and violates the
read-only contract of this type.
- Parameter body: A closure that receives a pointer to the audio buffer list.
- Returns: The value returned by the closure.
Creates a read-only buffer by retaining the existing PCM buffer without copying.
- Warning: The caller must ensure the original buffer is not modified while this
read-only buffer is in use. Violating this contract results in undefined behavior.
- Parameter buffer: The PCM buffer to retain (not copied).
Creates a read-only buffer by allocating and initializing audio data via closure.
- Parameters:
- format: The audio format for the buffer.
- frameCapacity: The capacity in audio frames.
- initializingWith: Closure that receives the mutable AudioBufferList to initialize.
- Throws: An error if allocation fails or the closure throws.
Creates a read-only buffer by copying audio data from an existing PCM buffer.
This initializer creates a new `AVAudioPCMBuffer` and copies all audio data,
ensuring the original buffer can continue to be used safely.
- Parameter buffer: The source PCM buffer to copy from.
Skipped declarations
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
AVReadOnlyAudioPCMBuffer.channelData(_:)
The iOS SDK compiler rejected this binding: instance method 'out' requires that 'AVReadOnlyAudioPCMBuffer.ChannelData' be a class type