https://github.com/maximelafarie/embed_lyrics
A script to embed lyrics in audio files
https://github.com/maximelafarie/embed_lyrics
audio audio-processing ffmpeg lyrics lyrics-plugin
Last synced: 30 days ago
JSON representation
A script to embed lyrics in audio files
- Host: GitHub
- URL: https://github.com/maximelafarie/embed_lyrics
- Owner: maximelafarie
- License: mit
- Created: 2026-02-25T21:32:12.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-02-25T21:36:26.000Z (4 months ago)
- Last Synced: 2026-05-07T16:07:43.820Z (about 2 months ago)
- Topics: audio, audio-processing, ffmpeg, lyrics, lyrics-plugin
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# embed_lyrics
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](https://beets.io/) and other tools that don't support standalone `.lrc` files.
---
## Dependencies
- [ffmpeg](https://ffmpeg.org/) — embedding for mp3, m4a, ogg, opus, wav, aiff
- [flac](https://xiph.org/flac/) (`metaflac`) — native lossless embedding for FLAC files
Install via Homebrew:
```zsh
brew install ffmpeg flac
```
---
## Installation
```zsh
chmod +x embed_lyrics.sh
mv embed_lyrics.sh /usr/local/bin/embed_lyrics
```
The script is then available from any directory.
---
## Usage
```zsh
# Current directory (recursive)
embed_lyrics
# Specified directory
embed_lyrics ~/Music
embed_lyrics /Volumes/NAS/Albums
```
---
## Behaviour
The 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 `.lrc` file is deleted
- ❌ **Failure** → the `.lrc` file is kept and an error is displayed
---
## Supported formats
| 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.
---
## Sample output
```
[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] ────────────────────────────────
```