<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SoundAnalysis",
  "identifier" : "/documentation/SoundAnalysis/SNAudioStreamAnalyzer/add(_:withObserver:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Sound Analysis"
    ],
    "preciseIdentifier" : "c:objc(cs)SNAudioStreamAnalyzer(im)addRequest:withObserver:error:"
  },
  "title" : "add(_:withObserver:)"
}
-->

# add(_:withObserver:)

Adds a new analysis request to the audio stream analyzer.

```
func add(_ request: any SNRequest, withObserver observer: any SNResultsObserving) throws
```

## Parameters

`request`

A sound analysis request.

`observer`

An [`SNResultsObserving`](/documentation/SoundAnalysis/SNResultsObserving) instance that receives the analyzer’s results. The analyzer maintains a weak reference to the observer.

## Discussion

You can add requests to an analyzer that’s actively analyzing an audio stream. The analyzer throws an error (Swift) or returns <doc://com.apple.documentation/documentation/ObjectiveC/NO> (Objective-C) if it can’t accept the new request, such as a request with an audio format that doesn’t match the analyzer’s.

---

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)