Class SpeechSynthesisCancellationDetails


  • public class SpeechSynthesisCancellationDetails
    extends Object
    Contains detailed information about why a speech synthesis was canceled. Added in version 1.7.0
    • Method Detail

      • fromResult

        public static SpeechSynthesisCancellationDetails fromResult​(SpeechSynthesisResult result)
        Creates an instance of SpeechSynthesisCancellationDetails object for the canceled SpeechSynthesisResult.
        Parameters:
        result - The speech synthesis result that was canceled.
        Returns:
        The cancellation details object being created.
      • fromStream

        public static SpeechSynthesisCancellationDetails fromStream​(AudioDataStream stream)
        Creates an instance of SpeechSynthesisCancellationDetails object for the canceled AudioDataStream.
        Parameters:
        stream - The audio data stream that was canceled.
        Returns:
        The cancellation details object being created.
      • close

        public void close()
        Explicitly frees any external resource attached to the object
      • getReason

        public CancellationReason getReason()
        The reason the recognition was canceled.
        Returns:
        Specifies the reason canceled.
      • getErrorCode

        public CancellationErrorCode getErrorCode()
        The error code in case of an unsuccessful recognition (when getReason() returns Error). Added in version 1.1.0.
        Returns:
        An error code that represents the error reason.
      • getErrorDetails

        public String getErrorDetails()
        The error message in case of an unsuccessful recognition (when getReason() returns Error).
        Returns:
        A String that represents the error details.
      • toString

        public String toString()
        Returns a String that represents the cancellation details.
        Overrides:
        toString in class Object
        Returns:
        A String that represents the cancellation details.