Class Recognizer

    • Constructor Detail

      • Recognizer

        protected Recognizer​(AudioConfig audioInput)
        Creates and initializes an instance of a Recognizer
        Parameters:
        audioInput - An optional audio input configuration associated with the recognizer
    • Method Detail

      • close

        public void close()
        Dispose of associated resources. Note: close() must be called in order to release underlying resources held by the object.
        Specified by:
        close in interface AutoCloseable
      • getImpl

        public SafeHandle getImpl()
        Returns the internal recognizer instance
        Returns:
        The internal recognizer instance
      • dispose

        protected void dispose​(boolean disposing)
        This method performs cleanup of resources. The Boolean parameter disposing indicates whether the method is called from Dispose (if disposing is true) or from the finalizer (if disposing is false). Derived classes should override this method to dispose resource if needed.
        Parameters:
        disposing - Flag to request disposal.
      • doAsyncRecognitionAction

        protected void doAsyncRecognitionAction​(Runnable recoImplAction)
        Internal method to run recognition operation.
        Parameters:
        recoImplAction - The runnable of the recognition operation.
      • recognize

        protected long recognize()
        Internal method to start recognize once operation.
        Returns:
        The native result handle of the recognition.
      • sessionStartedEventCallback

        protected void sessionStartedEventCallback​(long eventArgs)
        Internal method to handle native session started event.
        Parameters:
        eventArgs - The native event args.
      • sessionStoppedEventCallback

        protected void sessionStoppedEventCallback​(long eventArgs)
        Internal method to handle native session stopped event.
        Parameters:
        eventArgs - The native event args.
      • speechStartDetectedEventCallback

        protected void speechStartDetectedEventCallback​(long eventArgs)
        Internal method to handle native speech start detected event.
        Parameters:
        eventArgs - The native event args.
      • speechEndDetectedEventCallback

        protected void speechEndDetectedEventCallback​(long eventArgs)
        Internal method to handle native speech end detected event.
        Parameters:
        eventArgs - The native event args.
      • startContinuousRecognition

        protected final long startContinuousRecognition​(SafeHandle recoHandle)
        Internal method to start continuous recognition operation.
        Parameters:
        recoHandle - The native recognizer handle.
        Returns:
        The native result handle of the operation.
      • stopContinuousRecognition

        protected final long stopContinuousRecognition​(SafeHandle recoHandle)
        Internal method to stop continuous recognition operation.
        Parameters:
        recoHandle - The native recognizer handle.
        Returns:
        The native result handle of the operation.
      • startKeywordRecognition

        protected final long startKeywordRecognition​(SafeHandle recoHandle,
                                                     SafeHandle keywordModelHandle)
        Internal method to start keyword recognition operation.
        Parameters:
        recoHandle - The native recognizer handle.
        keywordModelHandle - The native keyword model handle.
        Returns:
        The native result handle of the operation.
      • stopKeywordRecognition

        protected final long stopKeywordRecognition​(SafeHandle recoHandle)
        Internal method to stop keyword recognition operation.
        Parameters:
        recoHandle - The native recognizer handle.
        Returns:
        The native result handle of the operation.
      • recognizingSetCallback

        protected final long recognizingSetCallback​(long recoHandle)
        Internal method to set recognizing callback.
        Parameters:
        recoHandle - The native recognizer handle.
        Returns:
        The native result handle of the operation.
      • recognizedSetCallback

        protected final long recognizedSetCallback​(long recoHandle)
        Internal method to set recognized callback.
        Parameters:
        recoHandle - The native recognizer handle.
        Returns:
        The native result handle of the operation.
      • canceledSetCallback

        protected final long canceledSetCallback​(long recoHandle)
        Internal method to set canceled callback.
        Parameters:
        recoHandle - The native recognizer handle.
        Returns:
        The native result handle of the operation.
      • sessionStartedSetCallback

        protected final long sessionStartedSetCallback​(long recoHandle)
        Internal method to set session started callback.
        Parameters:
        recoHandle - The native recognizer handle.
        Returns:
        The native result handle of the operation.
      • sessionStoppedSetCallback

        protected final long sessionStoppedSetCallback​(long recoHandle)
        Internal method to set session stopped callback.
        Parameters:
        recoHandle - The native recognizer handle.
        Returns:
        The native result handle of the operation.
      • speechStartDetectedSetCallback

        protected final long speechStartDetectedSetCallback​(long recoHandle)
        Internal method to set speech start detected callback.
        Parameters:
        recoHandle - The native recognizer handle.
        Returns:
        The native result handle of the operation.
      • speechEndDetectedSetCallback

        protected final long speechEndDetectedSetCallback​(long recoHandle)
        Internal method to set speech end detected callback.
        Parameters:
        recoHandle - The native recognizer handle.
        Returns:
        The native result handle of the operation.
      • getPropertyBagFromRecognizerHandle

        protected final long getPropertyBagFromRecognizerHandle​(SafeHandle recoHandle,
                                                                IntRef propertyHandle)
        Internal method to get the property bag from the recognizer handle.
        Parameters:
        recoHandle - The native recognizer handle.
        propertyHandle - The native property handle.
        Returns:
        The native result handle of the operation.