init(inputAudioFile:modules:options:analysisContext:finishAfterFile:volatileRangeChangedHandler:)
Creates an analyzer and begins analysis on an audio file.
Declaration
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 throwsParameters
- 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(). - 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.