CMSampleBufferSetDataBufferFromAudioBufferList(_:blockBufferAllocator:blockBufferMemoryAllocator:flags:bufferList:)
Creates a block buffer that contains a copy of the data from an audio buffer list.
Declaration
func CMSampleBufferSetDataBufferFromAudioBufferList(_ sbuf: CMSampleBuffer, blockBufferAllocator blockBufferStructureAllocator: CFAllocator?, blockBufferMemoryAllocator blockBufferBlockAllocator: CFAllocator?, flags: UInt32, bufferList: UnsafePointer<AudioBufferList>) -> OSStatusParameters
- sbuf:
The
CMSampleBufferbeing modified. - blockBufferStructureAllocator:
Allocator to use when creating the
CMBlockBufferstructure. - blockBufferBlockAllocator:
Allocator to use for memory block held by the
CMBlockBuffer. - flags:
Flags controlling operation.
- bufferList:
Buffer list whose data will be copied into the new
CMBlockBuffer.
Return Value
A result code. See Sample Buffer Error Codes.
Discussion
Creates a CMBlockBuffer containing a copy of the data from the AudioBufferList, and sets that as the sample buffer’s data buffer. The resulting buffer(s) in the sample buffer will be 16-byte-aligned if kCMSampleBufferFlag_AudioBufferList_Assure16ByteAlignment is passed in.
See Also
Modifying Sample Buffers
CMSampleBufferGetDataBuffer(_:)CMSampleBufferSetDataBuffer(_:newValue:)CMSampleBufferGetImageBuffer(_:)CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer(_:bufferListSizeNeededOut:bufferListOut:bufferListSize:blockBufferAllocator:blockBufferMemoryAllocator:flags:blockBufferOut:)CMSampleBufferCopyPCMDataIntoAudioBufferList(_:at:frameCount:into:)CMSampleBufferGetAudioStreamPacketDescriptions(_:allocatedSize:packetDescriptionsOut:packetDescriptionsSizeNeededOut:)CMSampleBufferGetAudioStreamPacketDescriptionsPtr(_:packetDescriptionsPointerOut:sizeOut:)