Documentation
¶
Overview ¶
Package subtitle generates SRT and WebVTT subtitles from STT transcription results.
Index ¶
- func GenerateSRT(result *stt.TranscriptionResult, opts Options) string
- func GenerateVTT(result *stt.TranscriptionResult, opts Options) string
- func SaveSRT(result *stt.TranscriptionResult, filePath string, opts Options) error
- func SaveVTT(result *stt.TranscriptionResult, filePath string, opts Options) error
- type Format
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSRT ¶
func GenerateSRT(result *stt.TranscriptionResult, opts Options) string
GenerateSRT generates SRT subtitle content from a transcription result.
func GenerateVTT ¶
func GenerateVTT(result *stt.TranscriptionResult, opts Options) string
GenerateVTT generates WebVTT subtitle content from a transcription result.
Types ¶
type Options ¶
type Options struct {
// MaxCharsPerLine limits characters per subtitle line.
// Default: 42 (standard for readability).
MaxCharsPerLine int
// MaxLinesPerCue limits lines per subtitle cue.
// Default: 2.
MaxLinesPerCue int
// MaxDuration limits the maximum duration for a single cue.
// Default: 7 seconds.
MaxDuration time.Duration
// MinDuration sets the minimum duration for a cue to be readable.
// Default: 1 second.
MinDuration time.Duration
// IncludeSpeakerLabels adds speaker labels to cues.
IncludeSpeakerLabels bool
}
Options configures subtitle generation.
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns sensible defaults for subtitle generation.
Click to show internal directories.
Click to hide internal directories.