1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use aspasia::{AssSubtitle, Error, SubRipSubtitle, Subtitle, TimedSubtitleFile, WebVttSubtitle};

fn main() -> Result<(), Error> {
    let sub = TimedSubtitleFile::new("/path/to/file.srt")?;

    // Get the file as its specific format
    let srt = SubRipSubtitle::from(sub);

    // You can use into() to convert the file
    let vtt: WebVttSubtitle = srt.into();

    // or from()
    let ass = AssSubtitle::from(vtt);

    ass.export("/path/to/converted.ass")?;

    Ok(())
}