<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Sound Analysis"
    ],
    "preciseIdentifier" : "c:objc(cs)SNAudioStreamAnalyzer"
  },
  "title" : "SNAudioStreamAnalyzer"
}
-->

# SNAudioStreamAnalyzer

An object you create to analyze a stream of audio data and provide the results to your app.

```
class SNAudioStreamAnalyzer
```

## Overview

Run an [`SNRequest`](/documentation/SoundAnalysis/SNRequest) on an audio stream by creating an `SNAudioStreamAnalyzer`. You can run the same sound analysis request on multiple stream analyzers, and each analyzer can process multiple requests. An audio file analyzer generates an [`SNResult`](/documentation/SoundAnalysis/SNResult) each time any of its active requests recognizes a sound.

## Topics

### Creating an Analyzer

[`-  initWithFormat:`](/documentation/SoundAnalysis/SNAudioStreamAnalyzer/init(format:))

Creates a new audio stream analyzer.

### Managing Requests

[`-  addRequest:withObserver:error:`](/documentation/SoundAnalysis/SNAudioStreamAnalyzer/add(_:withObserver:))

Adds a new analysis request to the audio stream analyzer.

[`SNRequest`](/documentation/SoundAnalysis/SNRequest)

A protocol that represents sound analysis requests.

[`SNResultsObserving`](/documentation/SoundAnalysis/SNResultsObserving)

The interface your app implements to receive the results of an analysis request.

[`-  removeRequest:`](/documentation/SoundAnalysis/SNAudioStreamAnalyzer/remove(_:))

Removes an existing request from the audio stream analyzer.

[`-  removeAllRequests`](/documentation/SoundAnalysis/SNAudioStreamAnalyzer/removeAllRequests())

Removes all the sound analysis requests from the audio stream analyzer.

### Analyzing Data

[`-  analyzeAudioBuffer:atAudioFramePosition:`](/documentation/SoundAnalysis/SNAudioStreamAnalyzer/analyze(_:atAudioFramePosition:))

Adds a new audio buffer to the analyzer’s larger stream buffer.

[`-  completeAnalysis`](/documentation/SoundAnalysis/SNAudioStreamAnalyzer/completeAnalysis())

Notifies the analyzer when it receives the final audio buffer.

## Relationships

### Conforms To

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

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

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

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

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

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

### 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)