Skip to content

mogita/go-sylt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GO SYLT

A pretty convenient CLI tool that reads and writes synced lyrics to MP3 files in SYLT (SYnchronized Lyrics/Text) format.

Software License Go Report Card Coverage Status

Features

  • Supported input formats: LRC, SRT, and VTT
  • Configurable language codes (case-insensitive 3-letter ISO 639-2 codes, e.g. eng, zho, und)
  • Read and display existing SYLT lyrics from MP3 files
  • Creates output files with " - sylt" suffix to preserve originals

Still, backing up originals is recommended.

Download

Visit the Releases page for pre-compiled binaries.

You can also build from source:

git clone https://github.com/mogita/go-sylt
cd go-sylt
go build

Usage

go-sylt [--lang <code>] <mp3_file> [lyrics_file]

Currently go-sylt supports ID3v2.3 and ID3v2.4 tags only. For MP3 files with older or unsupported ID3 versions, please convert them to a supported version first. You can use tools like Kid3 for this purpose.

Examples

# Write SYLT lyrics to MP3 file
./go-sylt song.mp3 lyrics.lrc

# Write lyrics and specify English language
./go-sylt --lang eng song.mp3 lyrics.srt

# Write lyrics using VTT format in Chinese
./go-sylt --lang zho song.mp3 subtitles.vtt

# Read existing SYLT lyrics from MP3 file and display
./go-sylt song.mp3

Language codes

--lang accepts any 3-letter ISO 639-2 code and is case-insensitive (ENG, Eng, and eng are all accepted and stored as eng). Common values:

  • eng — English
  • zho — Chinese
  • jpn — Japanese
  • kor — Korean
  • spa — Spanish
  • fra — French
  • deu — German
  • und — undetermined (default)

For the full list, see the ISO 639-2 language code list.

Output

The tool creates a new MP3 file with the same name as the input file but with " - sylt" appended before the extension. For example:

  • Input: song.mp3 → Output: song - sylt.mp3

Encoding

When writing SYLT frames, go-sylt always uses:

  • Text encoding: UTF-8 (ID3v2 encoding byte 0x03)
  • Timestamp format: absolute milliseconds (0x02)
  • Content type: lyrics (0x01)

This matches the format used by most modern players and avoids surrogate-pair pitfalls that affect UTF-16 handling. When reading SYLT frames, all four ID3v2 text encodings are supported (ISO-8859-1, UTF-16 with BOM, UTF-16 big-endian, UTF-8) so files written by other tools are readable.

If you need to write a non-UTF-8 SYLT frame, please open an issue describing your use case.

Credits

Contributing

Contributions are welcome! Should you find any issues or have any suggestions, kindly submit an issue or PR with the provided templates. Thank you!

Development

# Run tests
go test -v

# Run linter
golangci-lint run

Releasing

Visit the Releases page, create a release on the main branch with a tag in the format of X.Y.Z or X.Y.Z-rc1. The workflow will automatically build and upload the binaries.

License

MIT © mogita

About

A pretty convenient CLI tool that reads and writes synced lyrics to MP3 files in SYLT (SYnchronized Lyrics/Text) format.

Topics

Resources

License

Stars

6 stars

Watchers

0 watching

Forks

Contributors

Languages