<!--
{
  "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/setVolatileRangeChangedHandler(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Speech"
    ],
    "preciseIdentifier" : "s:6Speech0A8AnalyzerC30setVolatileRangeChangedHandleryyySo06CMTimeE0a_S2btcSgnF"
  },
  "title" : "setVolatileRangeChangedHandler(_:)"
}
-->

# setVolatileRangeChangedHandler(_:)

A closure that the analyzer calls when the volatile range changes.

```
final func setVolatileRangeChangedHandler(_ handler: sending ((CMTimeRange, Bool, Bool) -> Void)?)
```

## Parameters

`handler`

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.

## Discussion

You can use this handler to manage audio input resources and monitor progress.

You can also use this handler to respond to result finalization, but the better tool for that job is the [`resultsFinalizationTime`](/documentation/Speech/SpeechModuleResult/resultsFinalizationTime) property of a module’s results. When the analyzer calls this handler, the application may not have consumed the result from the stream yet; this handler may be called with a new volatile range while there are still results prior to the new volatile range waiting to be consumed.

This closure replaces any handler you specified when creating the analyzer.

---

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)