public final class TranscriptionSegment
- Object
- TranscriptionSegment
One timed transcript span. Times are offsets from the start of
the transcribed audio in milliseconds.
Constructors
public TranscriptionSegment(long startTimeMs, long endTimeMs, String text) | Creates a timed transcript span. |
Methods
public long getStartTimeMs() | Gets the segment start offset from the beginning of the audio. |
public long getEndTimeMs() | Gets the segment end offset from the beginning of the audio. |
public String getText() | Gets the text recognized in this segment. |
Inherited methods
Constructor details
TranscriptionSegment
public TranscriptionSegment(long startTimeMs, long endTimeMs, String text)Creates a timed transcript span.
Parameters
startTimeMslong- start offset from the beginning of the audio, in milliseconds
endTimeMslong- end offset from the beginning of the audio, in milliseconds
textString- text recognized in this span;
nullis treated as an empty string
Throws
IllegalArgumentException- if either timestamp is negative, or if
endTimeMsis beforestartTimeMs
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