GitHunt
LI

linjonh/SubtitleParserForAndroid

Subtitle file parser. support .ass, .srt format

SubtitleParserForAndroid

Subtitle file parser. support .ass, .srt format

reference from submerge
and then approve it to support android platform at least Android OS API 15, JAVA SDK 1.7.

because Submerge is for console program and using new JAVA SDK API 1.8, so it not support below android 26.

Usage

Parsing ASS subtitles:

File file = new File("subtitle.ass");

ASSParser parser = new ASSParser();
ASSSub subtitle = parser.parse(file);

System.out.println(subtitle.toString());
Parsing SRT subtitles:

File file = new File("subtitle.srt");
SRTParser parser = new SRTParser();

SRTSub subtitle = parser.parse(file);

System.out.println(subtitle.toString());

Using interfaces:

File file = new File("subtitle.srt");
String extension = FilenameUtils.getExtension(file.getName());

SubtitleParser parser = ParserFactory.getParser(extension);
TimedTextFile subtitle = parser.parse(file);

System.out.println(subtitle.toString());

Languages

Java100.0%

Contributors

MIT License
Created January 18, 2019
Updated December 30, 2025