You need the following packages:
- ffmpeg
- flac
- shntool
- cuetools
The following steps will convert a whole ape (with cue) to multiple flac tracks: (assume the system locale is UTF-8, cue has GBK characters)
- Convert cue to UTF-8: >$ cat orig.cue|iconv -f GBK -t UTF8 >cdimage.cue
- Convert ape to wav: >$ ffmpeg -vn -i cdimage.ape cdimage.wav
- Split the wav and encode to flac: >$ shnsplit -f cdimage.cue -o flac -t %n.%t cdimage.wav
- Add tags: >$ cuetag cdimage.cue *.flac