<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Speech",
  "identifier" : "/documentation/Speech/SpeechAnalyzer/analyzeSequence(from:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Speech"
    ],
    "preciseIdentifier" : "s:6Speech0A8AnalyzerC15analyzeSequence4fromSo6CMTimeaSgSo11AVAudioFileC_tYaKF"
  },
  "title" : "analyzeSequence(from:)"
}
-->

# analyzeSequence(from:)

Analyzes an input sequence created from an audio file, returning when the file has been read.

```
final func analyzeSequence(from audioFile: AVAudioFile) async throws -> CMTime?
```

## Parameters

`audioFile`

An `AVAudioFile` opened for reading.

## Return Value

The time-code of the last audio sample of the input, or `nil` if the file was empty. You may use this value for the parameter of [`finalizeAndFinish(through:)`](/documentation/Speech/SpeechAnalyzer/finalizeAndFinish(through:)) (or other methods).

## Discussion

When this method returns, the file will have been read, but the last of the audio may still be undergoing analysis. To wait for the analysis to complete, call another method such as [`finalize(through:)`](/documentation/Speech/SpeechAnalyzer/finalize(through:)) and await its return.

---

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)