SubtitleTrackclass

A sound's subtitle track - individual words over time, authored in the sound editor and stored in the sound's .meta file. Sample `Sandbox.SubtitleTrack.WordIndexAt(System.Single)` at the sound's playback time to show subtitles word by word, karaoke style.

objectSubtitleTrack
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public sealed class Sandbox.SubtitleTrack

Methods1

Showing 1 methods

public int WordIndexAt(float time)PUBLIC

Index into `Sandbox.SubtitleTrack.Words` of the latest word to have started at this time, or -1 before the first word. Words up to here have been spoken - that's the karaoke highlight. The word may have already ended; it's still being spoken while time is before its `Sandbox.SubtitleTrack.Word.EndTime`.

ParameterTypeDescription
timefloat
Returns:int

Properties3

Showing 3 properties

public float Sandbox.SubtitleTrack.Duration { get; set; }PUBLICGETSET

End time of the last word, in seconds.

Returns:float

public string Sandbox.SubtitleTrack.Text { get; set; }PUBLICGETSET

Every word joined together, e.g. "hello there friend" - the full subtitle for this sound.

Returns:string

public System.Collections.Generic.IReadOnlyList`1<Sandbox.SubtitleTrack.Word> Sandbox.SubtitleTrack.Words { get; set; }PUBLICGETSET

The words, sorted by start time.

Returns:IReadOnlyList<Word>

On this page