One Logo Pool Ball
AVFAudio · IOS API REFERENCE

AVReadOnlyAudioPCMBuffer

struct · iOS 27.0+ · SDK 27.1

struct AVReadOnlyAudioPCMBuffer

A read-only, Sendable audio buffer for safe concurrent access.

Members (8)

method · iOS 27.0+

withUnsafeAudioBufferList

TypeScript
withUnsafeAudioBufferList(body: ((arg0: SDKHandle) => unknown)): unknown
Swift declaration
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.

get · iOS 27.0+

frameLength

TypeScript
get frameLength(): number
Swift declaration
var frameLength: Int { get }
get · iOS 27.0+

frameCapacity

TypeScript
get frameCapacity(): number
Swift declaration
var frameCapacity: Int { get }
init · iOS 27.0+

init

TypeScript
static initUnsafeRetaining(buffer: AVAudioPCMBuffer): AVReadOnlyAudioPCMBuffer
Swift declaration
init(unsafeRetaining buffer: sending AVAudioPCMBuffer)

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).

init · iOS 27.0+

init

TypeScript
static initFormatFrameCapacityInitializingWith(format: AVAudioFormat, frameCapacity: number, initializingWith: ((arg0: SDKHandle) => void)): AVReadOnlyAudioPCMBuffer
Swift declaration
init(format: AVAudioFormat, frameCapacity: Int, initializingWith: (UnsafeMutablePointer<AudioBufferList>) throws -> Void) throws

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.

get · iOS 27.0+

format

TypeScript
get format(): AVAudioFormat
Swift declaration
var format: AVAudioFormat { get }
get · iOS 27.0+

stride

TypeScript
get stride(): number
Swift declaration
var stride: Int { get }
init · iOS 27.0+

init

TypeScript
static initCopying(buffer: AVAudioPCMBuffer): AVReadOnlyAudioPCMBuffer
Swift declaration
init(copying buffer: AVAudioPCMBuffer)

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

All AVFAudio types →