---
title: "analyzeSequence(from:)"
framework: speech
role: symbol
role_heading: Instance Method
path: "speech/speechanalyzer/analyzesequence(from:)"
---

# analyzeSequence(from:)

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

## Declaration

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

## Parameters

- `audioFile`: An AVAudioFile opened for reading.

## Return Value

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:) (or other methods).

## Discussion

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:) and await its return.

## See Also

### Performing analysis

- [analyzeSequence(_:)](speech/speechanalyzer/analyzesequence(_:).md)
