ubuntu linux下使用.cue对flac/ape分轨及转码

经常从verycd.com上下载音乐,不少是高质量的ape和flac格式的(恩,verycd真是个好东西~),但是linux下貌似还没有播放器支持cue索引的ape/flac镜像(?),更严重的是我的COWON D2虽然支持ape/flac,但是同样不支持cue文件。在网上搜索了一通,解决办法总结如下。
需要的工具有flac,shntool ,ubuntu下安装:
$sudo apt-get install flac shntool

要对ape分轨的话需要linux版的mac编解码器,编译安装
对cue索引的flac分轨:
$ shntool split -t "%n.%p-%t" -f example.cue -o flac example.flac -d output
-d 指定分轨后的falc文件的输出目录,不指定的话在当前目录生成
-t 指定输出文件的文件名格式,%n是音轨号,%p是演奏者/艺术家, %t标题

对ape分轨也类似,
$ shntool split -t "%n.%p-%t" -f example.cue -o ape example.ape -d output
另外,通过shntool,还可以把ape/flac镜像转换成其他音频格式,例如,要转换成mp3的话,
$ sudo apt-get install lame
$ shntool split -t "%n.%p-%t" -f example.cue -o 'cust ext=mp3 lame --r3mix -b 320 --quiet - %f' example.flac -d output

PS,

  • 目前发现ape分轨成多个ape似乎会出现错误无法处理,但是将ape分轨然后转码成其他格式(flac,mp3…)是没有问题的,flac和其他格式之间没有问题;
  • cue文件的字符集最好与系统当前使用的字符集相同,否则最好用iconv 转码后进行,否则最后生成的文件名可能乱码;
  • 给shntool指定-t参数虽然可以按照cue文件内容格式化输出的文件名,但是似乎还没有办法给文件tagging,还没找到解决的办法,只能手工来了

Update: 对于分轨的tagging,可以使用Exfalso这个工具(最近发现EasyTAG也能实现),它有一项功能“tags from path”可以实现,这个工具是quod libet播放器的一部分

3 Responses to “ubuntu linux下使用.cue对flac/ape分轨及转码”


  1. 1 YangDX CHINA Windows Vista Mozilla Firefox 2.0.0.7

    那天心血来潮,装了各linux。查点把我弄疯了。看来我对操作系统的DIY性需求没有那么强烈。换回了vista。今天看了ubuntu7.10的3d show video。感觉挺不错的。不过,如果工作还是win适合些。 已经把博客改版成功了。虽然有些功能还没有实现,所以,不用帮我套wp的函数了。 嘿嘿…

  2. 2 shellex CHINA Linux Mozilla Firefox 2.0.0.13

    提示错误哈
    $ shnsplit -f A.cue -i ape -o flac A.ape
    shnsplit: warning: failed to read data from input file using format: [ape]
    shnsplit: + you may not have permission to read file: [A.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

  3. 3 admin CHINA Linux Mozilla Firefox 3.0b5

    to shellex:

    试试shntool split -t “%n.%p-%t” -f A.cue -o ‘flac flake - %f’ A.ape 如果你的意思是要把ape分轨转成flac的话,希望有所帮助.

Leave a Reply