public class BaseSynthesizeCallback extends Object implements SynthesizeCallback
Constructor and Description |
---|
BaseSynthesizeCallback() |
Modifier and Type | Method and 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.
|
public void onConnected()
SynthesizeCallback
onConnected
in interface SynthesizeCallback
public void onError(Exception e)
SynthesizeCallback
onError
in interface SynthesizeCallback
e
- the exceptionpublic void onWarning(Exception e)
SynthesizeCallback
onWarning
in interface SynthesizeCallback
e
- the exceptionpublic void onDisconnected()
SynthesizeCallback
onDisconnected
in interface SynthesizeCallback
public void onContentType(String contentType)
SynthesizeCallback
onContentType
in interface SynthesizeCallback
contentType
- the content type of the synthesized audiopublic void onTimings(Timings timings)
SynthesizeCallback
onTimings
in interface SynthesizeCallback
timings
- array of words and their start and end timespublic void onMarks(Marks marks)
SynthesizeCallback
onMarks
in interface SynthesizeCallback
marks
- array of marks and their appearance timespublic void onAudioStream(byte[] bytes)
SynthesizeCallback
onAudioStream
in interface SynthesizeCallback
bytes
- array of bytes in the specified audio format or the default
(audio/ogg;codecs=opus)Copyright © 2024 IBM Cloud. All rights reserved.