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 voidonAudioStream(byte[] bytes)Called when the service returns byte info in the specified audio format as a result of synthesis.voidonConnected()Called when a WebSocket connection was made.voidonContentType(String contentType)Called when the service returns the type of audio it will be sending back.voidonDisconnected()Called when a WebSocket connection was closed.voidonError(Exception e)Called when there is an error in the WebSocket connection.voidonMarks(Marks marks)Called when the service returns SSML mark information.voidonTimings(Timings timings)Called when the service returns word timing information.voidonWarning(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:SynthesizeCallbackCalled when a WebSocket connection was made.- Specified by:
onConnectedin interfaceSynthesizeCallback
-
onError
Description copied from interface:SynthesizeCallbackCalled when there is an error in the WebSocket connection.- Specified by:
onErrorin interfaceSynthesizeCallback- Parameters:
e- the exception
-
onWarning
Description copied from interface:SynthesizeCallbackCalled when there is a warning in the WebSocket connection.- Specified by:
onWarningin interfaceSynthesizeCallback- Parameters:
e- the exception
-
onDisconnected
public void onDisconnected()Description copied from interface:SynthesizeCallbackCalled when a WebSocket connection was closed.- Specified by:
onDisconnectedin interfaceSynthesizeCallback
-
onContentType
Description copied from interface:SynthesizeCallbackCalled when the service returns the type of audio it will be sending back.- Specified by:
onContentTypein interfaceSynthesizeCallback- Parameters:
contentType- the content type of the synthesized audio
-
onTimings
Description copied from interface:SynthesizeCallbackCalled when the service returns word timing information.- Specified by:
onTimingsin interfaceSynthesizeCallback- Parameters:
timings- array of words and their start and end times
-
onMarks
Description copied from interface:SynthesizeCallbackCalled when the service returns SSML mark information.- Specified by:
onMarksin interfaceSynthesizeCallback- Parameters:
marks- array of marks and their appearance times
-
onAudioStream
public void onAudioStream(byte[] bytes)Description copied from interface:SynthesizeCallbackCalled when the service returns byte info in the specified audio format as a result of synthesis.- Specified by:
onAudioStreamin interfaceSynthesizeCallback- Parameters:
bytes- array of bytes in the specified audio format or the default (audio/ogg;codecs=opus)
-