Lilt is a cross-platform command-line tool that converts Hi-Res FLAC and ALAC files to 16-bit FLAC files with a sample rate of 44.1kHz or 48kHz. Written in Go for excellent performance and cross-platform compatibility.
Lilt stands for "lightweight intelligent lossless transcoder". It is also a form of traditional singing common in the Goidelic speaking areas of Ireland, Scotland and the Isle of Man, though singing styles like it occur in many other countries.
- 🎵 FLAC Support: Converts 24-bit FLAC files to 16-bit FLAC using SoX
- 🍎 ALAC Support: Converts ALAC (.m4a) files to FLAC format
- 16-bit 44.1kHz/48kHz ALAC files are converted to FLAC with the same quality
- Hi-Res ALAC files are converted to 16-bit FLAC following the same rules as FLAC files
- � Format Enforcement: Convert all audio files to a specific output format:
- FLAC: Convert all FLAC, ALAC, and MP3 files to 16-bit FLAC
- MP3: Convert all FLAC and ALAC files to 320kbps MP3 (preserves existing MP3 files)
- ALAC: Convert all FLAC and MP3 files to 16-bit ALAC (optimizes existing ALAC files)
- �📉 Downsamples high sample rate files:
- 384kHz, 192kHz, or 96kHz → 48kHz
- 352.8kHz, 176.4kHz, 88.2kHz → 44.1kHz
- 🔄 Preserves existing 16-bit FLAC files without unnecessary conversion
- 📝 Preserves ID3 tags and cover art from original files using FFmpeg (default: enabled; use --no-preserve-metadata to disable)
- 🎶 Copies MP3 files without modification (unless format enforcement is enabled)
- 🖼️ Optional: Copies JPG and PNG images from the source directory
- 🐳 Docker support for containerized execution
- 💻 Cross-platform: Windows, macOS, Linux (x64, ARM64, x86, ARM)
For Linux and macOS, you can use the installation script:
curl -sSL https://raw.githubusercontent.com/Ardakilic/lilt/main/install.sh | bashOr download and run it manually:
wget https://raw.githubusercontent.com/Ardakilic/lilt/main/install.sh
chmod +x install.sh
./install.shFor macOS users, you can install Lilt using Homebrew:
brew tap Ardakilic/lilt
brew install liltDownload the latest release for your platform from the Releases page:
- Windows:
lilt-windows-amd64.exe(x64) orlilt-windows-arm64.exe(ARM64) - macOS:
lilt-darwin-amd64(Intel) orlilt-darwin-arm64(Apple Silicon) - Linux:
lilt-linux-amd64(x64),lilt-linux-arm64(ARM64),lilt-linux-386(x86), orlilt-linux-arm(ARM)
git clone https://github.com/Ardakilic/lilt.git
cd lilt
go build -o lilt .You can use this tool in one of two ways:
-
Using Docker (recommended):
- Docker must be installed on your system
- No local SoX installation required
- Uses
ardakilic/sox_ng:latestby default, which includes both sox_ng and FFmpeg.
-
Using Local Installation:
- SoX (Sound eXchange) must be installed. SoX Project
- Install on Debian/Ubuntu:
sudo apt install sox - Install on macOS:
brew install sox - Install on Windows: Use WSL and install depending on the subsystem, or download SoX Windows binaries
- Install on Debian/Ubuntu:
- FFmpeg must be installed for ALAC support and metadata preservation. FFmpeg Downloads
- Install on Debian/Ubuntu:
sudo apt install ffmpeg - Install on macOS:
brew install ffmpeg - Install on Windows: Download from official site or use package manager
- Install on Debian/Ubuntu:
- You can also use SoX-NG: A drop-in replacement for SoX (SoX-NG Project)
- SoX (Sound eXchange) must be installed. SoX Project
lilt <source_directory> [options]--target-dir <dir> Specify target directory (default: ./transcoded)
--copy-images Copy JPG and PNG files
--no-preserve-metadata Do not preserve ID3 tags and cover art using FFmpeg (default: false)
--enforce-output-format <fmt> Enforce output format for all files: flac, mp3, or alac
--use-docker Use Docker to run Sox instead of local installation
--docker-image <img> Specify Docker image (default: ardakilic/sox_ng:latest)
--self-update Check for updates and self-update if newer version available
Using local SoX installation:
# Windows
lilt.exe "C:\Music\MyAlbum" --target-dir "C:\Music\MyAlbum-16bit" --copy-images
# macOS/Linux
./lilt ~/Music/MyAlbum --target-dir ~/Music/MyAlbum-16bit --copy-imagesUsing Docker:
# Windows
lilt.exe "C:\Music\MyAlbum" --target-dir "C:\Music\MyAlbum-16bit" --use-docker
# macOS/Linux
./lilt ~/Music/MyAlbum --target-dir ~/Music/MyAlbum-16bit --use-dockerConvert all files to MP3:
# Windows
lilt.exe "C:\Music\MyAlbum" --enforce-output-format mp3 --target-dir "C:\Music\MyAlbum-MP3"
# macOS/Linux
./lilt ~/Music/MyAlbum --enforce-output-format mp3 --target-dir ~/Music/MyAlbum-MP3Convert all files to ALAC:
# Windows
lilt.exe "C:\Music\MyAlbum" --enforce-output-format alac --target-dir "C:\Music\MyAlbum-ALAC"
# macOS/Linux
./lilt ~/Music/MyAlbum --enforce-output-format alac --target-dir ~/Music/MyAlbum-ALACCheck for updates:
lilt --self-updateWhen using the --use-docker option:
- Docker must be installed on your system
- The tool mounts your source and target directories as volumes in the container
- No local SoX installation is required
- Uses
ardakilic/sox_ng:latestby default, which is a containerized version of SoX-NG - Source code of the Docker image is available here
You can specify a different Docker image with the --docker-image option:
lilt ~/Music/MyAlbum --use-docker --docker-image your/sox-image:tagAlternative Docker images you can use:
bigpapoo/sox: Another SoX Docker image- Any image that provides SoX installed as the
soxcommand
- The tool scans the source directory recursively for
.flac,.m4a(ALAC), and.mp3files - For FLAC files:
- If a FLAC file is 24-bit, it is converted to 16-bit using SoX
- If a FLAC file has a sample rate of 96kHz, 192kHz, or 384kHz, it is downsampled to 48kHz
- If a FLAC file has a sample rate of 88.2kHz, it is downsampled to 44.1kHz
- 16-bit FLAC files at 44.1kHz or 48kHz are copied without conversion
- For ALAC files (.m4a):
- All ALAC files are converted to FLAC format using FFmpeg
- 16-bit 44.1kHz/48kHz ALAC files are converted to FLAC maintaining the same quality
- Hi-Res ALAC files follow the same bit depth and sample rate conversion rules as FLAC files
- ID3 tags and cover art are preserved from source to converted files using FFmpeg (unless --no-preserve-metadata is used)
- MP3 files are copied without modification
- If
--copy-imagesis enabled,.jpgand.pngfiles are copied to the target directory - The original folder structure is preserved in the target directory
When using --enforce-output-format, all audio files are converted to the specified format:
- FLAC files: Converted to 16-bit FLAC if needed, or copied if already 16-bit
- ALAC files: Converted to 16-bit FLAC
- MP3 files: Copied as-is (MP3 files are not converted to lossless formats)
- FLAC files: Converted to 320kbps MP3
- ALAC files: Converted to 320kbps MP3
- MP3 files: Copied without modification
- Sample rate is intelligently preserved (48kHz family → 48kHz, 44.1kHz family → 44.1kHz)
- FLAC files: Converted to 16-bit ALAC (.m4a)
- MP3 files: Copied as-is (MP3 files are not converted to lossless formats)
- ALAC files: Converted to 16-bit ALAC if needed, or copied if already 16-bit
- Written in Go for excellent cross-platform compatibility and performance
- Uses SoX's
--multi-threadedoption for performance - The
-Gflag ensures proper gain handling - Uses
ditherwhen downsampling to 16-bit for better quality - Maintains the same folder structure in the target directory
- Graceful error handling - if conversion fails, the original file is copied
For detailed development information, including advanced build options, testing procedures, and contribution guidelines, see Development.md.
- Go 1.24.5 or later
- Make (optional, for convenience)
# Clone the repository
git clone https://github.com/Ardakilic/lilt.git
cd lilt
# Build for current platform
go build -o lilt .
# Or use Make
make build# Run tests
go test -v ./...
# Or use Make
make testTo enable the self-update feature, set the version during build:
# Set specific version
go build -ldflags="-X main.version=v1.2.3" -o lilt .
# Use git tags (recommended)
make build # Automatically uses git describe for versioningSee Development.md for detailed version management and build options.
The project uses GitHub Actions to automatically build binaries for all supported platforms on every commit. The workflow:
- Builds for Windows, macOS, and Linux
- Supports x64, ARM64, x86, and ARM architectures
- Creates downloadable artifacts
- Can be triggered manually via GitHub Actions
- Creates pre-releases for development builds
If you're migrating from the original bash script (flac-converter.sh), the usage is identical. Simply replace:
# Old
./flac-converter.sh ~/Music/Album --target-dir ~/Music/Album-16bit
# New
./lilt ~/Music/Album --target-dir ~/Music/Album-16bitAll command-line arguments remain the same for seamless migration.
This project is open-source under the MIT License.
Arda Kilicdagi
Contributions are welcome! Please feel free to submit a Pull Request.