<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureSpatialAudioMetadataSampleGenerator",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureSpatialAudioMetadataSampleGenerator"
  },
  "title" : "AVCaptureSpatialAudioMetadataSampleGenerator"
}
-->

# AVCaptureSpatialAudioMetadataSampleGenerator

An interface for generating a spatial audio timed metadata sample.

```
class AVCaptureSpatialAudioMetadataSampleGenerator
```

## Topics

### Analyzing audio samples

[`func analyzeAudioSample(CMSampleBuffer) -> OSStatus`](/documentation/AVFoundation/AVCaptureSpatialAudioMetadataSampleGenerator/analyzeAudioSample(_:))

Analyzes the provided audio sample buffer for its contribution to the spatial audio timed metadata value.

[`func newTimedMetadataSampleBufferAndResetAnalyzer() -> Unmanaged<CMSampleBuffer>?`](/documentation/AVFoundation/AVCaptureSpatialAudioMetadataSampleGenerator/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.

[`var timedMetadataSampleBufferFormatDescription: CMFormatDescription`](/documentation/AVFoundation/AVCaptureSpatialAudioMetadataSampleGenerator/timedMetadataSampleBufferFormatDescription)

Returns the format description of the sample buffer returned from the [`newTimedMetadataSampleBufferAndResetAnalyzer()`](/documentation/AVFoundation/AVCaptureSpatialAudioMetadataSampleGenerator/newTimedMetadataSampleBufferAndResetAnalyzer()) method.

[`func resetAnalyzer()`](/documentation/AVFoundation/AVCaptureSpatialAudioMetadataSampleGenerator/resetAnalyzer())

Calling this method resets the analyzer to its initial state so that a new run of audio sample buffers can be analyzed.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)