subs

package
v0.0.0-...-8bec978 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(reader io.Reader) (buffer bytes.Buffer, err error)

Types

type Body

type Body struct {
	Paragraphs []Paragraph `xml:"p"`
}

type Paragraph

type Paragraph struct {
	Start     int        `xml:"t,attr"`    // Start time in milliseconds
	Length    int        `xml:"d,attr"`    // Duration in milliseconds
	Text      string     `xml:",chardata"` // Direct text (for cases without <s> tags)
	Sentences []Sentence `xml:"s"`         // List of <s> tags (for cases with individual words/phrases)
}

type Sentence

type Sentence struct {
	Text string `xml:",chardata"` // Text inside the <s> tag
	Time int    `xml:"t,attr"`    // Optional start time (not always present)
}

type TimedText

type TimedText struct {
	XMLName xml.Name `xml:"timedtext"`
	Body    Body     `xml:"body"`
}

Jump to

Keyboard shortcuts

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