pub fn parse(path_or_content: String) -> Result<SSAFile, Error>Expand description
Examples found in repository?
More examples
examples/convert_around.rs (line 15)
7 8 9 10 11 12 13 14 15 16 17 18 19
fn main() {
vtt::VTTFile::from(srt::SRTFile::from_str("./tests/fixtures/test.srt").unwrap()) // Can read either a file or a string
// converts file to WEBVTT
.to_file("./tests/fixtures/ex_test_1.vtt") // Writes the converted subtitle to a file
.unwrap();
ssa::SSAFile::from(vtt::parse("./tests/fixtures/test.vtt".to_string()).unwrap()) // converts file to SSA/ASS
.to_file("./tests/fixtures/ex_test_1.ass")
.unwrap();
srt::SRTFile::from(ssa::parse("./tests/fixtures/test.ass".to_string()).unwrap())
// converts file to SRT
.to_file("./tests/fixtures/ex_test_1.srt")
.unwrap();
}