linux convert mp3 to wav
Posted dahu的菜园子
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux convert mp3 to wav相关的知识,希望对你有一定的参考价值。
link : https://www.cyberciti.biz/faq/convert-mp3-files-to-wav-files-in-linux/
Install mpg321 or mpg123
Type the following command under Debian / Ubuntu Linux, enter:
sudo apt-get install mpg321
OR
sudo apt-get install mpg123
I recommend using mpg123 as it is updated frequently.
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:
mpg123 -w output.wav input.mp3
OR
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+):
mp3towav(){ [[ $# -eq 0 ]] && { echo "mp3wav mp3file"; exit 1; } for i in "[email protected]" 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:
mp3towav *.mp3 mp3towav "this is a test.mp3" ls *.wav
以上是关于linux convert mp3 to wav的主要内容,如果未能解决你的问题,请参考以下文章
Macsome iTunes Converter for Mac如何将 Apple Music 转换为 Mac 的 MP3/AAC/WAV/FLAC/AIFF?