SpeechRecognizer Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This class provides access to the speech recognition service.
[Android.Runtime.Register("android/speech/SpeechRecognizer", DoNotGenerateAcw=true)]
public class SpeechRecognizer : Java.Lang.Object
[<Android.Runtime.Register("android/speech/SpeechRecognizer", DoNotGenerateAcw=true)>]
type SpeechRecognizer = class
inherit Object
- Inheritance
- Attributes
Remarks
This class provides access to the speech recognition service. This service allows access to the speech recognizer. Do not instantiate this class directly, instead, call SpeechRecognizer#createSpeechRecognizer(Context)
, or SpeechRecognizer#createOnDeviceSpeechRecognizer(Context)
. This class's methods must be invoked only from the main application thread.
The implementation of this API is likely to stream audio to remote servers to perform speech recognition. As such this API is not intended to be used for continuous recognition, which would consume a significant amount of battery and bandwidth.
Please note that the application must have android.Manifest.permission#RECORD_AUDIO
permission to use this class.
Java documentation for android.speech.SpeechRecognizer
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Constructors
SpeechRecognizer(IntPtr, JniHandleOwnership) |
A constructor used when creating managed representations of JNI objects; called by the runtime. |
Fields
ConfidenceScores |
Key used to retrieve a float array from the |
DetectedLanguage |
Key used to retrieve a |
ErrorAudio |
Obsolete.
Audio recording error. |
ErrorCannotCheckSupport |
Obsolete.
The service does not allow to check for support. |
ErrorCannotListenToDownloadEvents |
Obsolete.
The service does not support listening to model downloads events. |
ErrorClient |
Obsolete.
Other client side errors. |
ErrorInsufficientPermissions |
Obsolete.
Insufficient permissions |
ErrorLanguageNotSupported |
Obsolete.
Requested language is not available to be used with the current recognizer. |
ErrorLanguageUnavailable |
Obsolete.
Requested language is supported, but not available currently (e. |
ErrorNetwork |
Obsolete.
Other network related errors. |
ErrorNetworkTimeout |
Obsolete.
Network operation timed out. |
ErrorNoMatch |
Obsolete.
No recognition result matched. |
ErrorRecognizerBusy |
Obsolete.
RecognitionService busy. |
ErrorServer |
Obsolete.
Server sends error status. |
ErrorServerDisconnected |
Obsolete.
Server has been disconnected, e. |
ErrorSpeechTimeout |
Obsolete.
No speech input |
ErrorTooManyRequests |
Obsolete.
Too many requests from the same client. |
LanguageDetectionConfidenceLevel |
Key used to retrieve the level of confidence of the detected language
of the most recent audio chunk,
represented by an |
LanguageDetectionConfidenceLevelConfident | |
LanguageDetectionConfidenceLevelHighlyConfident | |
LanguageDetectionConfidenceLevelNotConfident | |
LanguageDetectionConfidenceLevelUnknown | |
LanguageSwitchResult |
Key used to retrieve the result of the language switch of the most recent audio chunk,
represented by an |
LanguageSwitchResultFailed |
Obsolete.
Switch attempted and failed. |
LanguageSwitchResultNotAttempted |
Obsolete.
Switch not attempted. |
LanguageSwitchResultSkippedNoModel |
Obsolete.
Switch skipped because the language model is missing or the language is not allowlisted for auto switch. |
LanguageSwitchResultSucceeded |
Obsolete.
Switch attempted and succeeded. |
RecognitionParts |
Key used to receive an ArrayList< |
ResultsAlternatives |
Key used to retrieve an ArrayList< |
ResultsRecognition |
Key used to retrieve an |
TopLocaleAlternatives |
Key used to retrieve an ArrayList< |
Properties
Class |
Returns the runtime class of this |
Handle |
The handle to the underlying Android instance. (Inherited from Object) |
JniIdentityHashCode | (Inherited from Object) |
JniPeerMembers | |
PeerReference | (Inherited from Object) |
ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
Methods
Cancel() |
Cancels the speech recognition. |
CheckRecognitionSupport(Intent, IExecutor, IRecognitionSupportCallback) |
Checks whether |
Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
CreateOnDeviceSpeechRecognizer(Context) |
Factory method to create a new |
CreateSpeechRecognizer(Context, ComponentName) |
Factory method to create a new |
CreateSpeechRecognizer(Context) |
Factory method to create a new |
Destroy() |
Destroys the |
Dispose() | (Inherited from Object) |
Dispose(Boolean) | (Inherited from Object) |
Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
IsOnDeviceRecognitionAvailable(Context) |
Checks whether an on-device speech recognition service is available on the system. |
IsRecognitionAvailable(Context) |
Checks whether a speech recognition service is available on the system. |
JavaFinalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
SetRecognitionListener(IRecognitionListener) |
Sets the listener that will receive all the callbacks. |
StartListening(Intent) |
Starts listening for speech. |
StopListening() |
Stops listening for speech. |
ToArray<T>() | (Inherited from Object) |
ToString() |
Returns a string representation of the object. (Inherited from Object) |
TriggerModelDownload(Intent, IExecutor, IModelDownloadListener) |
Attempts to download the support for the given |
TriggerModelDownload(Intent) |
Attempts to download the support for the given |
UnregisterFromRuntime() | (Inherited from Object) |
Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Events
BeginningOfSpeech | |
BufferReceived | |
EndOfSegmentedSession | |
EndOfSpeech | |
Error | |
Event | |
LanguageDetection | |
PartialResults | |
ReadyForSpeech | |
Results | |
RmsChanged | |
SegmentResults |
Explicit Interface Implementations
IJavaPeerable.Disposed() | (Inherited from Object) |
IJavaPeerable.DisposeUnlessReferenced() | (Inherited from Object) |
IJavaPeerable.Finalized() | (Inherited from Object) |
IJavaPeerable.JniManagedPeerState | (Inherited from Object) |
IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from Object) |
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from Object) |
IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from Object) |
Extension Methods
JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
JavaCast<TResult>(IJavaObject) | |
GetJniTypeName(IJavaPeerable) |