Trust is earned, not given

A different perspective

2020-10-18 · Projects

CaptionConverter: turning any subtitle file into scrolling lyrics

Music players show scrolling lyrics from .lrc files — timestamped text like [01:23.45]lyric line. Subtitles come in a dozen other formats. This project, SrtToLrcConverterSimple-CSharp, converts between them, available as both a WPF desktop app and a command-line tool sharing one conversion core.

Eight input formats, auto-detected by content

SRT, WebVTT, SSA/ASS, SAMI, MicroDVD (frame-based, configurable FPS), MPL2, PJS and TTML/DFXP (XML). The interesting decision: detection is by content, not file extension. Extensions lie — a ".srt" may actually be VTT. Each format has a recognisable signature (SRT's numeric counters, WebVTT's WEBVTT header, TTML's XML namespace), and the converter sniffs before parsing. Batch mode walks a folder recursively, and one bad file is reported and skipped instead of aborting the run.

The parsing lessons in here are transferable

Project structure

One solution, two UIs, one core library. The WPF app adds drag-and-drop and progress; the CLI adds automation. Conversion logic lives in neither — it is the shared dependency, which is why both stay correct.

Repository: github.com/bobhuang1/SrtToLrcConverterSimple-CSharp