@@ -12,12 +12,16 @@ Lilt stands for "lightweight intelligent lossless transcoder". It is also a form
1212- 🍎 ** ALAC Support** : Converts ALAC (.m4a) files to FLAC format
1313 - 16-bit 44.1kHz/48kHz ALAC files are converted to FLAC with the same quality
1414 - Hi-Res ALAC files are converted to 16-bit FLAC following the same rules as FLAC files
15- - 📉 Downsamples high sample rate files:
15+ - � ** Format Enforcement** : Convert all audio files to a specific output format:
16+ - ** FLAC** : Convert all FLAC, ALAC, and MP3 files to 16-bit FLAC
17+ - ** MP3** : Convert all FLAC and ALAC files to 320kbps MP3 (preserves existing MP3 files)
18+ - ** ALAC** : Convert all FLAC and MP3 files to 16-bit ALAC (optimizes existing ALAC files)
19+ - �📉 Downsamples high sample rate files:
1620 - 384kHz, 192kHz, or 96kHz → 48kHz
1721 - 352.8kHz, 176.4kHz, 88.2kHz → 44.1kHz
1822- 🔄 Preserves existing 16-bit FLAC files without unnecessary conversion
1923- 📝 Preserves ID3 tags and cover art from original files using FFmpeg (default: enabled; use --no-preserve-metadata to disable)
20- - 🎶 Copies MP3 files without modification
24+ - 🎶 Copies MP3 files without modification (unless format enforcement is enabled)
2125- 🖼️ Optional: Copies JPG and PNG images from the source directory
2226- 🐳 Docker support for containerized execution
2327- 💻 Cross-platform: Windows, macOS, Linux (x64, ARM64, x86, ARM)
@@ -85,12 +89,13 @@ lilt <source_directory> [options]
8589### Options:
8690
8791```
88- --target-dir <dir> Specify target directory (default: ./transcoded)
89- --copy-images Copy JPG and PNG files
90- --no-preserve-metadata Do not preserve ID3 tags and cover art using FFmpeg (default: false)
91- --use-docker Use Docker to run Sox instead of local installation
92- --docker-image <img> Specify Docker image (default: ardakilic/sox_ng:latest)
93- --self-update Check for updates and self-update if newer version available
92+ --target-dir <dir> Specify target directory (default: ./transcoded)
93+ --copy-images Copy JPG and PNG files
94+ --no-preserve-metadata Do not preserve ID3 tags and cover art using FFmpeg (default: false)
95+ --enforce-output-format <fmt> Enforce output format for all files: flac, mp3, or alac
96+ --use-docker Use Docker to run Sox instead of local installation
97+ --docker-image <img> Specify Docker image (default: ardakilic/sox_ng:latest)
98+ --self-update Check for updates and self-update if newer version available
9499```
95100
96101### Examples:
@@ -113,6 +118,24 @@ lilt.exe "C:\Music\MyAlbum" --target-dir "C:\Music\MyAlbum-16bit" --use-docker
113118./lilt ~ /Music/MyAlbum --target-dir ~ /Music/MyAlbum-16bit --use-docker
114119```
115120
121+ Convert all files to MP3:
122+ ``` bash
123+ # Windows
124+ lilt.exe " C:\Music\MyAlbum" --enforce-output-format mp3 --target-dir " C:\Music\MyAlbum-MP3"
125+
126+ # macOS/Linux
127+ ./lilt ~ /Music/MyAlbum --enforce-output-format mp3 --target-dir ~ /Music/MyAlbum-MP3
128+ ```
129+
130+ Convert all files to ALAC:
131+ ``` bash
132+ # Windows
133+ lilt.exe " C:\Music\MyAlbum" --enforce-output-format alac --target-dir " C:\Music\MyAlbum-ALAC"
134+
135+ # macOS/Linux
136+ ./lilt ~ /Music/MyAlbum --enforce-output-format alac --target-dir ~ /Music/MyAlbum-ALAC
137+ ```
138+
116139Check for updates:
117140``` bash
118141lilt --self-update
@@ -139,6 +162,8 @@ Alternative Docker images you can use:
139162
140163## How It Works
141164
165+ ### Default Behavior (without --enforce-output-format)
166+
1421671 . The tool scans the source directory recursively for ` .flac ` , ` .m4a ` (ALAC), and ` .mp3 ` files
1431682 . ** For FLAC files:**
144169 - If a FLAC file is ** 24-bit** , it is converted to ** 16-bit** using SoX
@@ -154,6 +179,26 @@ Alternative Docker images you can use:
1541796 . If ` --copy-images ` is enabled, ` .jpg ` and ` .png ` files are copied to the target directory
1551807 . The original folder structure is preserved in the target directory
156181
182+ ### Format Enforcement Mode (with --enforce-output-format)
183+
184+ When using ` --enforce-output-format ` , all audio files are converted to the specified format:
185+
186+ #### FLAC Mode (` --enforce-output-format flac ` )
187+ - ** FLAC files** : Converted to 16-bit FLAC if needed, or copied if already 16-bit
188+ - ** ALAC files** : Converted to 16-bit FLAC
189+ - ** MP3 files** : Copied as-is (MP3 files are not converted to lossless formats)
190+
191+ #### MP3 Mode (` --enforce-output-format mp3 ` )
192+ - ** FLAC files** : Converted to 320kbps MP3
193+ - ** ALAC files** : Converted to 320kbps MP3
194+ - ** MP3 files** : Copied without modification
195+ - Sample rate is intelligently preserved (48kHz family → 48kHz, 44.1kHz family → 44.1kHz)
196+
197+ #### ALAC Mode (` --enforce-output-format alac ` )
198+ - ** FLAC files** : Converted to 16-bit ALAC (.m4a)
199+ - ** MP3 files** : Copied as-is (MP3 files are not converted to lossless formats)
200+ - ** ALAC files** : Converted to 16-bit ALAC if needed, or copied if already 16-bit
201+
157202## Technical Details
158203
159204- Written in Go for excellent cross-platform compatibility and performance
0 commit comments