SharpSubtitles is a reader/writer/converter between 3 subtitle formats: SRT, LRC, and ASS
var ass = new AssFile(File.ReadAllText("subtitles.ass"));
foreach (var subtitle in ass.GetSubtitles())
{
// do something with subtitle
}
var srt = new SrtFile(File.ReadAllText("subtitels.srt"));
foreach (var subtitle in srt.Subtitles)
{
// do something with subtitle
}
var lrc = new LrcFile(File.ReadAllText("subtitles.lrc"));
foreach (var subtitle in lrc.Subtitles)
{
// do something with subtitle
}
The SubtitleConvert
class has nested classes to convert subtitle formats:
- SubtitleConvert
- ASS
- ToSrt
- ToLrc
- SRT
- ToAss
- ToLrc
- LRC
- ToAss
- ToSrt
- ASS