A powerful Go program that automatically splits FLAC audio files based on CUE sheet information with comprehensive metadata tagging.
- π Automatic CUE File Discovery: Recursively finds all
.cuefiles in the workspace - π Organized Output Structure: Creates a well-organized directory structure in
split/folder - π΅ Three Splitting Modes: Pure Go (default), Hybrid, or External tools
- π·οΈ Comprehensive Metadata Tagging: Preserves all album and track information using go-flac
- π Detailed Logging: Provides clear progress updates with track information
- π Unicode Support: Handles CUE files with international characters
- β Error Handling: Robust error handling with detailed status reporting
- π No External Dependencies: Default mode works without any external tools
- No external tools required
- Decodes, splits, and re-encodes FLAC files using pure Go libraries
- Full metadata preservation with go-flac
- Works on any system with Go installed
- Moderate speed, perfect quality
- Go-based FLAC validation + external tools for splitting
- Fast splitting with comprehensive safety checks
- Displays detailed track timing information
- Requires shnsplit or ffmpeg
- Recommended for large collections
- Uses only shnsplit or ffmpeg
- Fastest option available
- Requires external tools
- Traditional approach
- *NothingREADME.md.bak README.md && mv QUICKSTART.md.bak QUICKSTART.md Just build and run
- Works out of the box with Go installed
Choose one of the following:
# Ubuntu/Debian
sudo apt-get install shntool flac
# macOS with Homebrew
brew install shntool flac
# Arch Linux
sudo pacman -S shntool flac# Ubuntu/Debian
sudo apt-get install ffmpeg
# macOS with Homebrew
brew install ffmpeg
# Arch Linux
sudo pacman -S ffmpeg# Build the program
make build
# Run with Pure Go mode (default - no external tools needed)
./flac-splitter
# Run with Hybrid mode (Go validation + external tools)
./flac-splitter --hybrid
# Run with External mode (fastest, requires shnsplit/ffmpeg)
./flac-splitter --external
# Prefer ffmpeg in external/hybrid mode
./flac-splitter --external --ffmpeg
# Custom output directory
./flac-splitter --output /path/to/output
# Or use make commands
make runThe program performs the following steps:
- Find all CUE files: Recursively searches the workspace for
.cuefiles - Parse metadata: Extracts album and track information from CUE sheets
- Create output structure: Creates organized directory structure in
split/ - Split FLAC files: Decodes and splits tracks (method depends on mode)
- Apply metadata: Writes comprehensive tags using go-flac library:
- Track title, artist, album, performer
- Track number, total tracks
- Date, genre, catalog, disc ID
- All custom CUE fields
split/
βββ One/
β βββ Motoi Sakuraba - Tales of Xillia Original Soundtrack CD2/
β β βββ 01 - The Sword That Dances Magnificently.flac
β β βββ 02 - A Mecca of Battles.flac
β β βββ ...
β βββ Motoi Sakuraba - Tales of Xillia Original Soundtrack CD3/
β βββ ...
βββ ...
./flac-splitter [flags]
Flags:
--external Use external tools only (shnsplit/ffmpeg) - fastest
--hybrid Hybrid mode: Go validation + external splitting
--ffmpeg Prefer ffmpeg over shnsplit (for external/hybrid)
-o, --output Output directory (default: "split")
-q, --quiet Quiet mode - only errors and summary
-v, --verbose Verbose mode - detailed progress
-h, --help Show help messagemake build # Build the FLAC splitter
make run # Build and run the FLAC splitter
make clean # Remove build artifacts and output directory
make clean-output # Remove only the split output directory
make install-deps # Install external dependencies (for hybrid/external modes)
make help # Show help message- Ensure the FLAC file referenced in the CUE file exists in the same directory
- Check that the filename matches (case-sensitive on Linux)
Solution: Use Pure Go mode (default) or install external tools:
# Use Pure Go mode (no external tools needed)
./flac-splitter
# Or install external tools for hybrid/external mode
make install-deps- Check FLAC file integrity:
flac -t yourfile.flac - Ensure sufficient disk space
- Verify CUE file format is valid
| Mode | Speed | Dependencies | Quality | Use Case |
|---|---|---|---|---|
| Pure Go | Moderate | None | Perfect | Default, no external tools |
| Hybrid | Fast | shnsplit/ffmpeg | Perfect | Large collections, with validation |
| External | Fastest | shnsplit/ffmpeg | Perfect | Maximum speed |
All modes use go-flac library for comprehensive metadata:
- Standard tags: TITLE, ARTIST, ALBUM, PERFORMER, DATE, GENRE
- Track numbering: TRACKNUMBER, TOTALTRACKS
- Extended: CATALOG, DISCID, DESCRIPTION
- Custom: Any additional CUE fields preserved
The codebase is organized into three main components:
internal/cueparser/- Generic CUE sheet parserinternal/flacsplitter/splitter.go- Core types and mode routersplitter_audio.go- Pure Go and hybrid implementationssplitter_external.go- External tools implementation
cmd/flac-splitter/- CLI with Cobra framework
Typical speeds per album:
- Pure Go: 1-2 minutes (moderate, no dependencies)
- Hybrid: 10-30 seconds (fast + validation)
- External: 5-15 seconds (fastest)
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.