<!--
{
  "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/SNAudioFileAnalyzer/analyze(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Sound Analysis"
    ],
    "preciseIdentifier" : "c:objc(cs)SNAudioFileAnalyzer(im)analyzeWithCompletionHandler:"
  },
  "title" : "analyze(completionHandler:)"
}
-->

# analyze(completionHandler:)

Analyzes the audio file asynchronously.

```
func analyze(completionHandler: @escaping @Sendable (Bool) -> Void)
```

## Parameters

`completionHandler`

A completion closure (Swift) or block (Objective-C) the analyzer calls when it finishes analyzing a file.

## Discussion

The method executes asynchronously and calls the completion handler after the analyzer finishes analyzing the entire file. The audio file analyzer sends errors to each request’s results observer.

If you call the [`cancelAnalysis()`](/documentation/SoundAnalysis/SNAudioFileAnalyzer/cancelAnalysis()) method, the analyzer calls your completion handler and passes `false` because it can’t reach the end of the file.

---

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)