那个 APE/Flac 转 mp3 脚本的更新

October 17th, 2008 | by vvoody |

用我之前写的那个 ape/flac 转 mp3 的脚本转最近下的几张专辑,发现多出一个 00.pregap.mp3; 并且 id3 写入也不对,后一个的 id3 写入了前一个的。

问题出在这些专辑抓录的时候在最前面多了段 gap,对应生成了 00.pregap.mp3 这个文件,于是原本第一首音乐的 id3 写到了 00.pregap.mp3,以此类推。

解决方法只要在脚本写入 id3 之前把那个 00.pregap.mp3 删掉即可。如果有朋友在用这个脚本,务必请更新一下;-)

--- one2mp3s.sh 2008-10-13 15:56:36.000000000 +0800
+++ one2mp3s.fix.sh     2008-10-13 17:18:52.000000000 +0800
@@ -53,6 +53,12 @@
 # More output format, see `man shntool`
 shntool split -f "$cuefile" -t '%n.%t' -o 'cust ext=mp3 lame -b 320 - %f' "$hifile"
 
+# Remove the pregrap file, or it will make write the id3 incorrectly.
+if [ -f "00.pregap.mp3" ]; then
+    rm -f 00.pregap.mp3
+    echo "00.pregap.mp3 found! Removed it."
+fi
+
 # Write the id3v2 into the mp3 files.
 acount=1
 for mp3file in *.mp3; do
  1. 2 Responses to “那个 APE/Flac 转 mp3 脚本的更新”

  2. By Grissiom on Oct 17, 2008

    Mozilla Firefox 3.0.3 Linux Mozilla Firefox 3.0.3 Linux

    顶!~~

    不过要是有能转 ogg 的脚本就更好了~

    Reply

    vvoody Reply:

    Opera 9.60 Linux

    嘿嘿,shntool可以转换成ogg等等格式的。
    shntool split -f “$cuefile” -t ‘%n.%t’ -o ‘cust ext=mp3 lame -b 192 – %f’ “$hifile”

    shntool 本身是不支持转换到 mp3 的,是通过 cust 参数调用 lame 进行转换的。

    so,找个 ogg 的编码器就应该可以了。

    Reply

Post a Comment