write_srt {srt} | R Documentation |
Write subtitle data frame as SubRip text file
Description
Write subtitle data frame as SubRip text file
Usage
write_srt(x, path = NULL, wrap = TRUE, width = 40)
Arguments
x |
A subtitle data frame from |
path |
File or connection to write to. |
wrap |
If |
width |
If |
Details
The SubRip text files format subtitles with four components separated by a blank line:
A numeric counter identifying each sequential subtitle
The time that the subtitle should appear on the screen, followed by
-->
and the time it should disappearSubtitle text itself on one or more lines
A blank line containing no text, indicating the end of this subtitle
Value
The path to the written file, invisibly.
Examples
# read and write without line breaks
x <- read_srt(srt_example(), collapse = " ")
write_srt(x, tempfile(fileext = ".srt"), wrap = FALSE)
[Package srt version 1.0.4 Index]