Calls a block for every individual sample in a sample buffer.
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 6.0+
- Core Media
CMSamplethat may contain multiple samples.
Block to be called for each individual sample.
Temporary sample buffers will be created for individual samples, referring to the sample data and containing its timing, size and attachments. The block may retain these sample buffers if desired. If the block returns an error, iteration will stop immediately and the error will be returned.
If there are no sample sizes in the provided sample buffer,
k will be returned. This will happen, for example, if the samples in the buffer are non-contiguous (e.g. non-interleaved audio, where the channel values for a single sample are scattered through the buffer).