Class TranscriptionSegment
java.lang.Object
com.codename1.media.TranscriptionSegment
One timed transcript span. Times are offsets from the start of
the transcribed audio in milliseconds.
-
Constructor Summary
ConstructorsConstructorDescriptionTranscriptionSegment(long startTimeMs, long endTimeMs, String text) Creates a timed transcript span. -
Method Summary
Modifier and TypeMethodDescriptionlongGets the segment end offset from the beginning of the audio.longGets the segment start offset from the beginning of the audio.getText()Gets the text recognized in this segment.
-
Constructor Details
-
TranscriptionSegment
Creates a timed transcript span.- Parameters:
startTimeMs- start offset from the beginning of the audio, in millisecondsendTimeMs- end offset from the beginning of the audio, in millisecondstext- text recognized in this span;nullis treated as an empty string- Throws:
IllegalArgumentException- if either timestamp is negative, or ifendTimeMsis 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
Gets the text recognized in this segment.- Returns:
- recognized text, never
null
-