Class TranscriptionSegment

java.lang.Object
com.codename1.media.TranscriptionSegment

public final class TranscriptionSegment extends Object
One timed transcript span. Times are offsets from the start of the transcribed audio in milliseconds.
  • Constructor Details

    • TranscriptionSegment

      public TranscriptionSegment(long startTimeMs, long endTimeMs, String text)
      Creates a timed transcript span.
      Parameters:
      startTimeMs - start offset from the beginning of the audio, in milliseconds
      endTimeMs - end offset from the beginning of the audio, in milliseconds
      text - text recognized in this span; null is treated as an empty string
      Throws:
      IllegalArgumentException - if either timestamp is negative, or if endTimeMs is before startTimeMs
  • Method Details

    • getStartTimeMs

      public long getStartTimeMs()
      Gets the segment start offset from the beginning of the audio.
      Returns:
      start offset in milliseconds
    • getEndTimeMs

      public long getEndTimeMs()
      Gets the segment end offset from the beginning of the audio.
      Returns:
      end offset in milliseconds
    • getText

      public String getText()
      Gets the text recognized in this segment.
      Returns:
      recognized text, never null