vtt

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatAsText

func FormatAsText(cues []Cue) string

FormatAsText produces a readable "Speaker: text" format suitable for LLM consumption. Adjacent cues from the same speaker are merged into a single line.

Types

type Cue

type Cue struct {
	Speaker string // e.g., "Speaker 1" or empty
	Text    string // cue text content
}

Cue represents a single WebVTT cue with optional speaker attribution.

func Parse

func Parse(data []byte) ([]Cue, error)

Parse extracts cues from WebVTT data. Handles the WEBVTT header, timestamp lines, and <v Speaker N> voice tags. Malformed cues are skipped; returns what can be parsed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL