linux convert mp3 to wav and opus to wav

link :  https://www.cyberciti.biz/faq/convert-mp3-files-to-wav-files-in-linux/linux

Install mpg321 or mpg123

Type the following command under Debian / Ubuntu Linux, enter:centos

 
sudo apt-get install mpg321

ORbash

sudo apt-get install mpg123

I recommend using mpg123 as it is updated frequently.ide

Install mpg123 under CentOS / RHEL / Fedora Linux

Turn on rpmforge repo and type the following command:工具

yum install mpg123

Convert an MP3 to WAV

The -w option will convert an .mp3 file to .wav file. The syntax is:post

mpg123 -w output.wav input.mp3

ORui

mpg321 -w output.wav input.mp3

A Sample Shell Script Helper Function

Add the following to your ~/.bashrc startup file (tested with bash v3.x+):this

mp3towav(){
    [[ $# -eq 0 ]] && { echo "mp3wav mp3file"; exit 1; }
    for i in "$@"
    do
        # create .wav file name
        local out="${i%/*}.wav"
        [[ -f "$i" ]] && { echo -n "Processing ${i}..."; mpg123 -w "${out}" "$i" &>/dev/null  && echo "done." || echo "failed."; }
    done
}

Use it as follows:spa

mp3towav *.mp3
mp3towav "this is a test.mp3"
ls *.wav

 

在 Linux 上使用 Opus Tools 將音樂轉成 Opus 格式

裝一下opus-tools便可code

sudo apt-get install opus-tools

Opus Tools 包含什麼工具?

Opus Tools 包含了如下幾種工具:

  • opusdec:Opus 的解碼器。
  • opusenc:Opus 的編碼器。
  • opusinfo:Opus 檔案的資訊顯示器。
  • opusrtp:發送 Opus 音訊至 RTP 串流,或從 RTP 串流接收 Opus 音訊。

詳細的,看一下連接

相關文章
相關標籤/搜索