转换需要用到下面这些软件,通过brew安装: brew install flac shntool cuetools ffmpeg 比如转换带cue的wav格式音乐:

luohui@MacBookPro:/Volumes/DATA HD/music/APE/李荣浩《李荣浩创作精选》$ shntool split -t "%p-%t" -f lrh.cue
enter input filename(s):
lrh.wav
shntool [split]: warning: discarding initial zero-valued split point
Splitting [lrh.wav] (69:04.36) --> [李荣浩-李白 .wav] (4:34.33) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-作曲家.wav] (3:47.42) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-模特 .wav] (5:07.18) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-太坦白.wav] (4:57.60) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-丑八怪.wav] (4:08.32) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-寂寞不痛.wav] (4:58.62) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-演员和歌手 .wav] (4:16.11) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-老伴 .wav] (3:28.40) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-蓝绿 .wav] (4:20.67) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-拜拜.wav] (5:36.60) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-哎呀.wav] (4:52.41) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-什么都没留.wav] (4:14.47) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-两个人 .wav] (4:50.46) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-有一个姑娘 .wav] (4:45.69) : 100% OK
Splitting [lrh.wav] (69:04.36) --> [李荣浩-都一样 .wav] (5:04.08) : 100% OK

这样就成功的把一个600多M的音乐分割十来个小文件了。

但是ape格式的在mac上转换不了,提示没有解码器:

luohui@MacBookPro:/Volumes/DATA HD/music/APE/莫文蔚.-.[滚石香港黄金十年-莫文蔚精选].专辑$ shnsplit -t "%p-%t" -f mww.cue   -o flac
enter input filename(s):
mww.ape
shnsplit: warning: failed to read data from input file using format: [ape]
shnsplit:          + you may not have permission to read file: [mww.ape]
shnsplit:          + arguments may be incorrect for decoder: [mac]
shnsplit:          + verify that the decoder is installed and in your PATH
shnsplit:          + this file may be unsupported, truncated or corrupt
shnsplit: error: cannot continue due to error(s) shown above

这个时候可以使用ffmpeg先转成flac,再分割:

luohui@MacBookPro:/Volumes/DATA HD/music/APE/莫文蔚.-.[滚石香港黄金十年-莫文蔚精选].专辑$ ffmpeg -i mww.ape  mww.flac
ffmpeg version 4.1.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, ape, from 'mww.ape':
  Duration: 01:05:51.81, start: 0.000000, bitrate: 868 kb/s
    Stream #0:0: Audio: ape (APE  / 0x20455041), 44100 Hz, stereo, s16p
File 'mww.flac' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (ape (native) -> flac (native))
Press [q] to stop, [?] for help
Output #0, flac, to 'mww.flac':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16, 128 kb/s
    Metadata:
      encoder         : Lavc58.35.100 flac
size=  431088kB time=01:05:51.81 bitrate= 893.6kbits/s speed=69.9x
video:0kB audio:431080kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001878%

然后再做分割:

luohui@MacBookPro:/Volumes/DATA HD/music/APE/莫文蔚.-.[滚石香港黄金十年-莫文蔚精选].专辑$ shnsplit -t "%p-%t" -f mww.cue
enter input filename(s):
mww.flac
shnsplit: warning: discarding initial zero-valued split point
Splitting [mww.flac] (65:51.61) --> [莫文蔚-陰天.wav] (4:03.10) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-他不愛我.wav] (3:58.35) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-忽然之間.wav] (3:22.34) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-雙城故事.wav] (4:16.41) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-愛我的請舉手.wav] (3:41.31) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-沒時間.wav] (4:30.35) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-想一個男生.wav] (3:42.12) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-電台情歌.wav] (4:08.65) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-真的嗎.wav] (5:22.14) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-愛情.wav] (4:46.41) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-十二樓.wav] (5:14.26) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-盛夏的果實.wav] (4:11.07) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-不要愛我.wav] (5:30.15) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-愛情真偉大.wav] (4:22.05) : 100% OK
Splitting [mww.flac] (65:51.61) --> [莫文蔚-Love yourself 愛自己.wav] (4:41.65) : 100% OK

完美!