SDK Reference · Method
stopRecognizeAudio
Stops the active speech-recognition operation.
Declaration
public func stopRecognizeAudio(
_ mode: STSpeechRecognitionStopMode = .finish
) -> STResultOverview
Requests that the active recognition operation stop asynchronously. The method returns before recognition has necessarily stopped; observe recognition events to determine completion. The .finish mode may produce a final hypothesis, while .cancel abandons recognition.
Modes
.finish asks the recognizer to finish the recognition operation so an available hypothesis can still be returned asynchronously.
.cancel cancels the recognition operation rather than requesting a final recognition result.
Default: .finish.
Return value
Returns .audioRecorderNotInitialized when the recorder is unavailable. Otherwise returns the result of the recognition stop request.