srt_seconds: Parse components of a subtitle file

Description Usage Arguments Value Examples

View source: R/parse.R

Description

Parse components of a subtitle file

Usage

1
2
3
4
5
srt_seconds(x)

srt_index(x)

srt_text(x, collapse = "\n")

Arguments

x

A character vector with the lines of an .srt file.

collapse

The character with which to separate subtitle lines.

Value

The parsed individual components of a subtitle: integer indexes, numeric times, and collapsed string subtitles.

Examples

1
2
3
4
5
# return individual components of each subtitle
x <- readLines(srt_example(1))
head(srt_seconds(x)[[1]])
head(srt_index(x))
head(srt_text(x))

srt documentation built on Nov. 30, 2020, 9:06 a.m.