Package ai.rev.speechtotext
Interface RevAiWebSocketListener
-
public interface RevAiWebSocketListenerListens for events over the WebSocket connection to Rev.ai
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonClose(int code, String reason)Supplies the close code and close reason received during a WebSocket CloseEvent.voidonConnected(ConnectedMessage message)Supplies the connection message received from Rev.ai.voidonError(Throwable t, okhttp3.Response response)Supplies the error and response received during a WebSocket ErrorEvent.voidonHypothesis(Hypothesis hypothesis)Supplies the Hypothesis returned from Rev.ai.voidonOpen(okhttp3.Response response)Supplies the response received during the handshake.
-
-
-
Method Detail
-
onConnected
void onConnected(ConnectedMessage message)
Supplies the connection message received from Rev.ai.- Parameters:
message- a String in JSON format that contains the message type and job ID.- See Also:
- https://www.rev.ai/docs/streaming#section/Rev.ai-to-Client-Response
-
onHypothesis
void onHypothesis(Hypothesis hypothesis)
Supplies the Hypothesis returned from Rev.ai.- Parameters:
hypothesis- the partial or final hypothesis of the audio.- See Also:
Hypothesis
-
onError
void onError(Throwable t, okhttp3.Response response)
Supplies the error and response received during a WebSocket ErrorEvent.- Parameters:
t- the error thrown.response- the WebSocket response to the error.
-
onClose
void onClose(int code, String reason)Supplies the close code and close reason received during a WebSocket CloseEvent.- Parameters:
code- the close code.reason- the close reason.
-
onOpen
void onOpen(okhttp3.Response response)
Supplies the response received during the handshake.- Parameters:
response- the handshake response.
-
-