Package ai.nexconn.chatui.handler
Class SpeechToTextHandler
-
- All Implemented Interfaces:
public class SpeechToTextHandler extends MultiDataHandler
Data handler for speech-to-text operations on voice messages.
Manages:
- Initiating speech-to-text requests
- Setting the visibility of transcription results
- Listening for transcription result callbacks
- Managing error states for transcription operations
- Since:
5.22.0
-
-
Field Summary
Fields Modifier and Type Field Description public final static MultiDataHandler.DataKey<UiMessage>KEY_SPEECH_TO_TEXT_LISTENERpublic final static MultiDataHandler.DataKey<UiMessage>KEY_REQUEST_SPEECH_TO_TEXTpublic final static MultiDataHandler.DataKey<UiMessage>KEY_SET_SPEECH_TO_TEXT_VISIBLEpublic final static StringSPEECH_TO_TEXT_HIDDEN_STATEpublic final static StringSPEECH_TO_TEXT_LOADING_STATEprotected volatile booleanisAlive
-
Constructor Summary
Constructors Constructor Description SpeechToTextHandler()
-
Method Summary
Modifier and Type Method Description voidrequestSpeechToTextForMessage(String messageUId)Initiates a speech-to-text transcription request for a voice message. voidsetMessageSpeechToTextVisible(int messageId, boolean isVisible)Sets the visibility of a speech-to-text transcription result. voidstop()Stops the handler. -
Methods inherited from class ai.nexconn.chatui.base.BaseHandler
isAlive -
Methods inherited from class ai.nexconn.chatui.base.MultiDataHandler
addDataChangeListener, notifyDataChange, notifyDataError, notifyDataError, replaceDataChangeListener -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
requestSpeechToTextForMessage
void requestSpeechToTextForMessage(String messageUId)
Initiates a speech-to-text transcription request for a voice message.
- Parameters:
messageUId- the unique message ID of the voice message to transcribe
-
setMessageSpeechToTextVisible
void setMessageSpeechToTextVisible(int messageId, boolean isVisible)
Sets the visibility of a speech-to-text transcription result.
- Parameters:
messageId- the client message IDisVisible-trueto show the transcription;falseto hide it
-
stop
void stop()
Stops the handler.
-
-
-
-