星期五, 3月 06, 2009

[Linux]amr 轉 mp3

環境:Ubuntu 8.10

  1. 安裝必要的套件:
    sudo apt-get install amrnb sox lame
  2. 輸入以下指令:
    amrnb-decoder file.amr file.raw # 先轉成 raw 檔
    sox -r 8000 -w -c 1 -s file.raw -r 16000 -w -c 1 file.wav # 再轉為 wav
    lame babycry.wav babycry.mp3 # 最後轉為 mp3


整理一下,把它作成 script:
#!/bin/bash
# amr2mp3.sh
FILE=`basename $1 .amr` # remove .amr
amrnb-decoder $1 $FILE.raw
sox -r 8000 -w -c 1 -s $FILE.raw -r 16000 -w -c 1 $FILE.wav
lame $FILE.wav $FILE.mp3
rm -f $FILE.raw $FILE.wav
exit 0


收工。

參考自Aquarionics 的 blog:How to convert AMR files to MP3

2 則留言:

The Moments of Fireworks 提到...

Hi,

Please kindly advise how to convert mp3 file to bin file. If you could help, I will be much appreciated.

Thanks.

elleryq 提到...

bin file??
Which format??

您或許對這些文章有興趣

Related Posts Plugin for WordPress, Blogger...