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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 interface SynthesizeCallback
    • onError

      public void onError​(Exception e)
      Description copied from interface: SynthesizeCallback
      Called when there is an error in the WebSocket connection.
      Specified by:
      onError in interface SynthesizeCallback
      Parameters:
      e - the exception
    • onWarning

      public void onWarning​(Exception e)
      Description copied from interface: SynthesizeCallback
      Called when there is a warning in the WebSocket connection.
      Specified by:
      onWarning in interface SynthesizeCallback
      Parameters:
      e - the exception
    • onDisconnected

      public void onDisconnected()
      Description copied from interface: SynthesizeCallback
      Called when a WebSocket connection was closed.
      Specified by:
      onDisconnected in interface SynthesizeCallback
    • onContentType

      public void onContentType​(String contentType)
      Description copied from interface: SynthesizeCallback
      Called when the service returns the type of audio it will be sending back.
      Specified by:
      onContentType in interface SynthesizeCallback
      Parameters:
      contentType - the content type of the synthesized audio
    • onTimings

      public void onTimings​(Timings timings)
      Description copied from interface: SynthesizeCallback
      Called when the service returns word timing information.
      Specified by:
      onTimings in interface SynthesizeCallback
      Parameters:
      timings - array of words and their start and end times
    • onMarks

      public void onMarks​(Marks marks)
      Description copied from interface: SynthesizeCallback
      Called when the service returns SSML mark information.
      Specified by:
      onMarks in interface SynthesizeCallback
      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 interface SynthesizeCallback
      Parameters:
      bytes - array of bytes in the specified audio format or the default (audio/ogg;codecs=opus)