IOError: [Errno 13] Permission denied: '/converted' . Trying to convert .mp3 file to .wav in python pydub

1.5k views Asked by At

I am trying to convert .mp3 extension file to .wav. This is my simple code.

from pydub import AudioSegment
sound = AudioSegment.from_mp3("english.mp3")
sound.export("/converted", format="wav")

After executing this code it shows IOError: [Errno 13] Permission denied: '/converted' . I changed permission for this directory.But still it shows same error please help me.

2

There are 2 answers

1
AudioBubble On BEST ANSWER

by the code audio_segment.py you need to set file path, mean full file path:

sound.export("/home/desktop/kivy/start/converted/english.wav", format="wav")
0
Alecg_O On

The accepted answer didn't work for me on Windows. Instead, I found that my anti-virus was flagging the activity as suspicious and denying access. After white-listing python.exe, the issue was fixed.