initializeSREngine
Initializes a speech-recognition engine and optionally selects its recognition language.
Declaration
public func initializeSREngine(
srEngine: String? = nil,
languageCode: String? = nil
) -> STResultOverview
Initializes a speech-recognition engine and optionally selects its recognition language. Check the documented prerequisites, parameters and return value below. For asynchronous operations, use the relevant media events to observe actual completion rather than treating an accepted request as finished.
Prerequisite
Initialize the audio recorder first. Speech-recognition services are managed through that component.
Supported engine: Currently, "Apple" is the only supported engine identifier for srEngine. Additional engines are reserved for future support.
Parameters
srEngine optionally identifies the recognition engine. languageCode optionally specifies the recognition language/locale, for example en-US.
Return value
Returns .audioRecorderNotInitialized when the recorder is unavailable. Otherwise returns the result of initializing the requested recognition engine.