ASRAgentProtocol
public protocol ASRAgentProtocol : CapabilityAgentable
ASR (AutomaticSpeechRecognition) is responsible for capturing the audio and delivering it to the server and receiving the result of speech recognition.
-
Adds a delegate to be notified of
ASRAgentstate changes.Declaration
Swift
func add(delegate: ASRAgentDelegate)Parameters
delegateThe object to add.
-
Removes a delegate from
ASRAgent.Declaration
Swift
func remove(delegate: ASRAgentDelegate)Parameters
delegateThe object to remove.
-
This function asks the
ASRAgentto send a Recognize Event to Server and start streaming fromAudioStream, which transitions it to therecognizingstate.This function can be called in
idleandexpectingSpeechstate.Declaration
Swift
@discardableResult func startRecognition( initiator: ASRInitiator, completion: ((StreamDataState) -> Void)? ) -> StringParameters
optionsThe options for recognition.
completionThe completion handler to call when the request is complete.
Return Value
The dialogRequestId for request.
-
Put the audio buffer to be processed.
Declaration
Swift
func putAudioBuffer(buffer: AVAudioPCMBuffer) -
This function forces the
ASRAgentback to theidlestate.This function can be called in any state, and will end any Event which is currently in progress.
Declaration
Swift
func stopRecognition()
-
startRecognition(initiator:Extension method) This function asks the
ASRAgentto send a Recognize Event to Server and start streaming fromAudioStream, which transitions it to therecognizingstate.This function can be called in
idleandexpectingSpeechstate.Declaration
Swift
@discardableResult func startRecognition(initiator: ASRInitiator) -> StringParameters
optionsThe options for recognition.
Return Value
The dialogRequestId for request.
View on GitHub
ASRAgentProtocol Protocol Reference