Class BaseSynthesizeCallback
java.lang.Object
com.ibm.watson.text_to_speech.v1.websocket.BaseSynthesizeCallback
- All Implemented Interfaces:
SynthesizeCallback
public class BaseSynthesizeCallback extends Object implements SynthesizeCallback
-
Constructor Summary
Constructors Constructor Description BaseSynthesizeCallback()
-
Method Summary
Modifier and Type Method Description void
onAudioStream(byte[] bytes)
Called when the service returns byte info in the specified audio format as a result of synthesis.void
onConnected()
Called when a WebSocket connection was made.void
onContentType(String contentType)
Called when the service returns the type of audio it will be sending back.void
onDisconnected()
Called when a WebSocket connection was closed.void
onError(Exception e)
Called when there is an error in the WebSocket connection.void
onMarks(Marks marks)
Called when the service returns SSML mark information.void
onTimings(Timings timings)
Called when the service returns word timing information.void
onWarning(Exception e)
Called when there is a warning in the WebSocket connection.
-
Constructor Details
-
BaseSynthesizeCallback
public BaseSynthesizeCallback()
-
-
Method Details
-
onConnected
public void onConnected()Description copied from interface:SynthesizeCallback
Called when a WebSocket connection was made.- Specified by:
onConnected
in interfaceSynthesizeCallback
-
onError
Description copied from interface:SynthesizeCallback
Called when there is an error in the WebSocket connection.- Specified by:
onError
in interfaceSynthesizeCallback
- Parameters:
e
- the exception
-
onWarning
Description copied from interface:SynthesizeCallback
Called when there is a warning in the WebSocket connection.- Specified by:
onWarning
in interfaceSynthesizeCallback
- Parameters:
e
- the exception
-
onDisconnected
public void onDisconnected()Description copied from interface:SynthesizeCallback
Called when a WebSocket connection was closed.- Specified by:
onDisconnected
in interfaceSynthesizeCallback
-
onContentType
Description copied from interface:SynthesizeCallback
Called when the service returns the type of audio it will be sending back.- Specified by:
onContentType
in interfaceSynthesizeCallback
- Parameters:
contentType
- the content type of the synthesized audio
-
onTimings
Description copied from interface:SynthesizeCallback
Called when the service returns word timing information.- Specified by:
onTimings
in interfaceSynthesizeCallback
- Parameters:
timings
- array of words and their start and end times
-
onMarks
Description copied from interface:SynthesizeCallback
Called when the service returns SSML mark information.- Specified by:
onMarks
in interfaceSynthesizeCallback
- Parameters:
marks
- array of marks and their appearance times
-
onAudioStream
public void onAudioStream(byte[] bytes)Description copied from interface:SynthesizeCallback
Called when the service returns byte info in the specified audio format as a result of synthesis.- Specified by:
onAudioStream
in interfaceSynthesizeCallback
- Parameters:
bytes
- array of bytes in the specified audio format or the default (audio/ogg;codecs=opus)
-