Python: Convert MP3 to WAV on Ubuntu

In this tutorial, we will introduce how to convert mp3 to wav file using python on ubuntu.

Python - Convert MP3 to WAV on Ubuntu for Beginners

1.Install pydub library

pip install pydub

2.Install ffmpeg

apt-get install ffmpeg

3.Import library

from os import path
from pydub import AudioSegment

4.Convert mp3 to wav using pydub

# files                                                                         
src = "transcript.mp3"
dst = "test.wav"

# convert wav to mp3                                                            
sound = AudioSegment.from_mp3(src)
sound.export(dst, format="wav")

Run this code, you will convert it successfully.

Python: Convert MP3 to WAV on Ubuntu