MicrophoneRecognitionClient Class Reference
Inherits from | Conversation : NSObject |
---|---|
Declared in | MicrophoneRecognitionClient.mm SpeechRecognitionService.h |
Overview
The Azure Intelligent Services speech recognition client for microphone input.
Voice input data is collected from the microphone and sent to the speech recognition service. A built-in Silence Detector is applied to microphone data before it is sent to the recognition service.
Returns only speech recognition results on the input data; does not perform intent detection.
Other Methods
– initWithSpeechRecoParams:withPrefs:withIntent:withProtocol:
Initializes a speech recognition client that uses the microphone as the input source.
- (id)initWithSpeechRecoParams:(SpeechRecognitionMode)speechRecognitionMode withPrefs:(AdmRecoOnlyPreferences *)prefs withIntent:(bool)wantIntent withProtocol:(id<SpeechRecognitionProtocol>)delegate
Parameters
speechRecognitionMode |
The speech recognition mode. In Short Phrase mode, the client receives one final multiple N-best choice result. In Long-form Dictation mode, the client receives multiple final results, based on where the server thinks sentence pauses are. |
---|---|
prefs |
A set of preferences used to configure the speech service. |
wantIntent |
Set this parameter to false |
delegate |
The speech recognition protocol callback |
Return Value
The microphone recognition client
Discussion
Initializes a speech recognition client that uses the microphone as the input source.
To initiate speech recognition, call the [startMicAndRecognition](#//api/name/startMicAndRecognition) method of this client. Once the microphone is turned on, data from the microphone is sent to the speech recognition service. A built-in Silence Detector is applied to the microphone data before it is sent to the recognition service. The recognition service returns only speech recognition results and does not perform intent detection. To terminate speech recognition and stop sending data to the service, call [endMicAndRecognition](#//api/name/endMicAndRecognition).
Declared In
MicrophoneRecognitionClient.mm
– startMicAndRecognition
Turns the microphone on and begins streaming data from the microphone to the speech recognition service.
- (OSStatus)startMicAndRecognition
Discussion
Turns the microphone on and begins streaming data from the microphone to the speech recognition service.
A built in Silence Detector is applied to the microphone data before it is sent to the service.
Declared In
MicrophoneRecognitionClient.mm
– endMicAndRecognition
Turns the microphone off and breaks the connection to the speech recognition service.
- (void)endMicAndRecognition
Discussion
Turns the microphone off and breaks the connection to the speech recognition service.
Declared In
MicrophoneRecognitionClient.mm
– waitForFinalResponse:
Waits the given number of seconds for a speech recognition response. Calling this method blocks the current thread until the response is received or the wait time is exceeded.
- (bool)waitForFinalResponse:(int)timeoutInSeconds
Parameters
timeoutInSeconds |
The response wait timeout, in seconds |
---|
Return Value
true if the final speech recognition result is sent from the speech recognition service or false if the timeout was reached.
Discussion
Waits the given number of seconds for a speech recognition response. Calling this method blocks the current thread until the response is received or the wait time is exceeded.
Declared In
MicrophoneRecognitionClient.mm
Extension Methods
isInitialized
Gets or sets a flag that indicates whether the microphone client is initialized
@property (nonatomic, readwrite, assign) Boolean isInitialized
Discussion
Gets or sets a flag that indicates whether the microphone client is initialized
Declared In
MicrophoneRecognitionClient.mm