Interface SynthesizeCallback

All Known Implementing Classes:
BaseSynthesizeCallback

public interface SynthesizeCallback
  • 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.
  • Method Details

    • onConnected

      void onConnected()
      Called when a WebSocket connection was made.
    • onError

      void onError​(Exception e)
      Called when there is an error in the WebSocket connection.
      Parameters:
      e - the exception
    • onWarning

      void onWarning​(Exception e)
      Called when there is a warning in the WebSocket connection.
      Parameters:
      e - the exception
    • onDisconnected

      void onDisconnected()
      Called when a WebSocket connection was closed.
    • onContentType

      void onContentType​(String contentType)
      Called when the service returns the type of audio it will be sending back.
      Parameters:
      contentType - the content type of the synthesized audio
    • onTimings

      void onTimings​(Timings timings)
      Called when the service returns word timing information.
      Parameters:
      timings - array of words and their start and end times
    • onMarks

      void onMarks​(Marks marks)
      Called when the service returns SSML mark information.
      Parameters:
      marks - array of marks and their appearance times
    • onAudioStream

      void onAudioStream​(byte[] bytes)
      Called when the service returns byte info in the specified audio format as a result of synthesis.
      Parameters:
      bytes - array of bytes in the specified audio format or the default (audio/ogg;codecs=opus)