<!--
{
  "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/init(inputAudioFile:modules:options:analysisContext:finishAfterFile:volatileRangeChangedHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Speech"
    ],
    "preciseIdentifier" : "s:6Speech0A8AnalyzerC14inputAudioFile7modules7options15analysisContext011finishAfterE027volatileRangeChangedHandlerACSo07AVAudioE0C_SayAA0A6Module_pGAC7OptionsVSgAA08AnalysisI0CSbySo06CMTimeM0a_S2btcSgntYaKcfc"
  },
  "title" : "init(inputAudioFile:modules:options:analysisContext:finishAfterFile:volatileRangeChangedHandler:)"
}
-->

# init(inputAudioFile:modules:options:analysisContext:finishAfterFile:volatileRangeChangedHandler:)

Creates an analyzer and begins analysis on an audio file.

```
convenience init(inputAudioFile: AVAudioFile, modules: [any SpeechModule], options: SpeechAnalyzer.Options? = nil, analysisContext: AnalysisContext = .init(), finishAfterFile: Bool = false, volatileRangeChangedHandler: sending ((CMTimeRange, Bool, Bool) -> Void)? = nil) async throws
```

## Parameters

`inputAudioFile`

An audio file opened for reading.

`modules`

An initial list of modules that will analyze the audio.

`options`

A structure specifying analysis options.

`analysisContext`

An object containing contextual information to improve or inform the analysis.

`finishAfterFile`

If `true`, the analysis will automatically finish after the audio file has been fully processed. Equivalent to calling [`finalizeAndFinishThroughEndOfInput()`](/documentation/Speech/SpeechAnalyzer/finalizeAndFinishThroughEndOfInput()).

`volatileRangeChangedHandler`

A closure called to report the analysis’ progress. The closure takes the following parameters:

- range: The current volatile range.
- changedStart: If `true`, the volatile range contains an updated start time. This indicates that prior results have been finalized.
- changedEnd: If `true`, the volatile range contains an update end time. This indicates that analysis of that time has started.

---

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)