A zsh script that embeds .lrc (synced lyrics) files directly into audio file metadata, in a completely lossless way.
Particularly useful for making lyrics compatible with beets and other tools that don't support standalone .lrc files.
- ffmpeg — embedding for mp3, m4a, ogg, opus, wav, aiff
- flac (
metaflac) — native lossless embedding for FLAC files
Install via Homebrew:
brew install ffmpeg flacchmod +x embed_lyrics.sh
mv embed_lyrics.sh /usr/local/bin/embed_lyricsThe script is then available from any directory.
# Current directory (recursive)
embed_lyrics
# Specified directory
embed_lyrics ~/Music
embed_lyrics /Volumes/NAS/AlbumsThe script recursively scans the target directory and, for each audio file found, checks whether a .lrc file with the same name exists in the same folder.
Artist - Album/
├── 01 - Track.flac ← audio file
├── 01 - Track.lrc ← will be embedded then deleted
├── 02 - Track.flac
└── ... ← no .lrc → silently skipped
- ✅ Successful embed → the
.lrcfile is deleted - ❌ Failure → the
.lrcfile is kept and an error is displayed
| Format | Method | Re-encoding |
|---|---|---|
.flac |
metaflac (LYRICS tag) |
❌ No |
.mp3 |
ffmpeg -c copy |
❌ No |
.m4a |
ffmpeg -c copy |
❌ No |
.ogg |
ffmpeg -c copy |
❌ No |
.opus |
ffmpeg -c copy |
❌ No |
.wav |
ffmpeg -c copy |
❌ No |
.aiff / .aif |
ffmpeg -c copy |
❌ No |
Audio quality is always preserved — only metadata is modified.
[INFO] Scanning: /Users/you/Music
[INFO] Embedding: 01 - Song.lrc → 01 - Song.flac
[OK] Done → 01 - Song.flac
[INFO] Embedding: 02 - Other.lrc → 02 - Other.flac
[OK] Done → 02 - Other.flac
[INFO] ────────────────────────────────
[OK] Embedded : 2 file(s)
[INFO] ────────────────────────────────