Contents

setVolatileRangeChangedHandler(_:)

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

Declaration

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 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.

See Also

Monitoring analysis