Class TranscriptionResult
java.lang.Object
com.codename1.media.TranscriptionResult
A complete transcription: plain text plus the timed segments needed
for captions.
-
Constructor Summary
ConstructorsConstructorDescriptionTranscriptionResult(List<TranscriptionSegment> segments) Creates a transcription result from timed segments. -
Method Summary
Modifier and TypeMethodDescriptionGets the ordered timed transcript segments.getText()Gets the plain transcript text.static TranscriptionResultCreates a text-only result for providers that do not expose segment timing.toSrt()Formats this transcription as SubRip captions.toVtt()Formats this transcription as WebVTT captions.
-
Constructor Details
-
TranscriptionResult
Creates a transcription result from timed segments.
The supplied list is copied, validated, and exposed through
getSegments()as an immutable list. The plain text returned bygetText()is the concatenation of each segment's text in order.- Parameters:
segments- ordered transcript segments- Throws:
IllegalArgumentException- ifsegmentsisnullor containsnull
-
-
Method Details
-
textOnly
Creates a text-only result for providers that do not expose segment timing.
The returned result contains one segment from
0to0milliseconds.- Parameters:
text- recognized text- Returns:
- a transcription result containing one untimed segment
-
getSegments
Gets the ordered timed transcript segments.- Returns:
- immutable segment list
-
getText
-
toSrt
Formats this transcription as SubRip captions.- Returns:
- SRT text using millisecond timestamps
-
toVtt
Formats this transcription as WebVTT captions.- Returns:
- WebVTT text using millisecond timestamps
-