newTimedMetadataSampleBufferAndResetAnalyzer()
Creates a sample buffer containing a spatial audio timed metadata sample computed from all analyzed audio buffers, and resets the analyzer to its initial state.
Declaration
func newTimedMetadataSampleBufferAndResetAnalyzer() -> Unmanaged<CMSampleBuffer>?Return Value
A CMSampleBufferRef containing the spatial audio timed metadata sample, or NULL if no value can be computed.
Discussion
Call this method after you pass the last audio sample buffer of your recording to analyzeAudioSample(_:). Then pass the returned CMSampleBufferRef directly to your AVAssetWriterInput to add the sample to your recording’s audio timed metadata track. Note that AVAssetWriter expects one and only one spatial audio metadata sample buffer to be present in the timed metadata track.