Package 

Interface AsrCallback


  • 
    public interface AsrCallback
    
                        

    Callback interface for ASR (Automatic Speech Recognition) module. Users can implement this interface to receive the transcribed tokens as they are generated.

    Warning: These APIs are experimental and subject to change without notice

    • Method Summary

      Modifier and Type Method Description
      abstract Unit onToken(String token) Called when a new token is available from JNI.
      Unit onError(Integer errorCode, String message) Called when an error occurs during transcription.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • onToken

         abstract Unit onToken(String token)

        Called when a new token is available from JNI. Users will keep getting onToken() invocations until transcription finishes (when the transcribe method returns).

        Parameters:
        token - The decoded text token
      • onError

         Unit onError(Integer errorCode, String message)

        Called when an error occurs during transcription.

        Parameters:
        errorCode - Error code from the ExecuTorch runtime
        message - Human-readable error description