Click or drag to resize
DataRecognitionClient Class
A client using speech recognition with data (for example from a file or audio source). The data is broken up into buffers and each buffer is sent to the Speech Recognition Service. No modification is done to the buffers, so the user can apply their Silence Detection. Returns only text recognition results. The audio must be PCM, mono, 16-bit sample, with sample rate of 8000 Hz or 16000 Hz.
Inheritance Hierarchy

Namespace: Microsoft.CognitiveServices.SpeechRecognition
Assembly: SpeechClient (in SpeechClient.dll) Version: 0.0.0.0
Syntax
public class DataRecognitionClient : Conversation, 
	IDataRecognitionClient

The DataRecognitionClient type exposes the following members.

Methods
  NameDescription
Public methodAudioStart
The microphone is turned on and 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.
(Inherited from Conversation.)
Public methodAudioStop
The microphone is turned off and the connection to the Speech Recognition Server is severed.
(Inherited from Conversation.)
Public methodCreateAudioStream
Gets an audio stream with no format specified. This method is used when the format information can be detected within the stream itself.
(Inherited from Conversation.)
Public methodCreateAudioStream(SpeechAudioFormat)
Gets an audio stream with the specified format. Use this method when sending raw audio samples.
(Inherited from Conversation.)
Public methodDispose (Inherited from Conversation.)
Protected methodDispose(Boolean)
Releases the unmanaged resources used by the DataRecognitionClient and optionally releases the managed resources
(Overrides ConversationDispose(Boolean).)
Public methodEndAudio
Notify the server that client is done sending audio buffers to the Speech Recognition Service. This work is queued onto a background worker.
Public methodEquals (Inherited from Object.)
Protected methodFinalize
Should only be called when client is ready to break the connection with the Speech Recognition Server. For example, after the Speech Recognition Server returns the final speech recognition result.
(Overrides Object.Finalize.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodSendAudio
Send buffers of audio to the Speech Recognition Service.Note for wave files, you can just send data from the file right to the server. The audio must be PCM, mono, 16-bit sample, with sample rate of 8000 Hz or 16000 Hz. In the case you are not an audio file in wave format, and instead you have just raw data(for example audio coming over bluetooth), then before sending up any audio data with this method, you must first send up an SpeechAudioFormat descriptor to describe the layout and format of your raw audio data via DataRecognitionClient's sendAudioFormat() method. This work is queued onto a background worker.
Public methodSendAudioFormat
If you are not sending up a audio file in wave format, and instead you have just raw data, then before sending up any audio data, you must first send up an SpeechAudioFormat descriptor to describe the layout and format of your raw audio data. The audio must be PCM, mono, 16-bit sample, with sample rate of 8000 Hz or 16000 Hz.
Public methodToString (Inherited from Object.)
Top
Properties
  NameDescription
Public propertyAuthenticationUri
Represents the authentication service endpoint
(Inherited from Conversation.)
Top
Events
  NameDescription
Public eventOnConversationError
Event fired when a conversation error occurs
(Inherited from Conversation.)
Public eventOnIntent
Event fired when a Speech Recognition has finished, the recognized text has been parsed with LUIS for intent and entities, and the structured JSON result is available.
(Inherited from Conversation.)
Public eventOnMicrophoneStatus
Event fired when the microphone recording status has changed.
(Inherited from Conversation.)
Public eventOnPartialResponseReceived
Event fired when a partial response is received
(Inherited from Conversation.)
Public eventOnResponseReceived
Event fired when a response is received
(Inherited from Conversation.)
Top
See Also