To convert an MP3 file to WAV format on a Linux system, you can use the ffmpeg
utility. ffmpeg
is a powerful, open-source, cross-platform media processing tool that can be used to convert audio and video files between various formats.
To install ffmpeg
, you will need to add the appropriate repository to your system's package manager. On a Debian-based system, such as Ubuntu, you can use the following command:
sudo add-apt-repository ppa:jonathonf/ffmpeg-4 sudo apt update sudo apt install ffmpeg
On a Red Hat-based system, such as CentOS, you can use the following commands:
sudo yum install epel-release sudo yum install ffmpeg
Once ffmpeg
is installed, you can use the ffmpeg
command to convert an MP3 file to WAV format. For example, to convert the file input.mp3
to WAV format and save the result to output.wav
, you can use the following command:
ffmpeg -i input.mp3 -acodec pcm_s16le -ac 2 -ar 44100 output.wav
This command will convert the MP3 file to a WAV file with stereo audio (-ac 2
), a sample rate of 44100 Hz (-ar 44100
), and a sample format of 16-bit signed integer (-acodec pcm_s16le
).
You can also use the -vn
option to disable video processing, if the input file is an audio/video file:
ffmpeg -vn -i input.mp3 -acodec pcm_s16le -ac 2 -ar 44100 output.wav
You can use the -y
option to overwrite the output file if it already exists:
ffmpeg -vn -y -i input.mp3 -acodec pcm_