$ sudo apt install cuetools shntool flac $ shnsplit -f input.cue -t %n-%t -o flac output.flac
You'll need flac, bchunk and ffmpeg. If you run Debian or Ubuntu, just type
$ sudo apt-get install flac ffmpeg
The first step is to convert the whole .ape into .wav.
$ ffmpeg -i input.ape output.wav
And convert to flac.
$ flac --best output.wav
Then you split the .wav into individual tracks.
$ shnsplit -f cuefile.cue -t %n-%t -o flac output.flac
You can then remove the .ape, .cue and interim .wav files.
$ ffmpeg -i input.flac -sample_fmt s16 -ar 44100 output.flac
List sample formats: ffmpeg -sample_fmts List additional flac encoding options: ffmpeg -h encoder=flac
FFmpeg supports two resamplers: the default swresample library, and the external SoX resampler (soxr).
$ ffmpeg -i input.flac -af aresample=out_sample_fmt=s16:out_sample_rate=44100 output.flac
Either example will result in the same output: you can verify with the hash muxer. Changing the dithering method See the -dither_method option for a list of available dithering methods and additional resampling options. Example:
$ ffmpeg -i input.flac -dither_method triangular_hp -sample_fmt s16 -ar 44100 output.flac
To use soxr your ffmpeg must be compiled with –enable-libsoxr. Then choose it with the -resampler option:
$ ffmpeg -i input.flac -resampler soxr -sample_fmt s16 -ar 44100 output.flac
Or use the aresample filter to do it all:
$ ffmpeg -i input.flac -af aresample=resampler=soxr:out_sample_fmt=s16:out_sample_rate=44100 output.flac