I used this code to convert the m4a file that I have and the audio file is in the same directory as my code, but the code can't find the file.
m4a_file = '1.m4a'
wav_filename = 'output.wav'
sound = AudioSegment.from_file(m4a_file, format='m4a')
sound.export(wav_filename, format='wav')
First, make sure you have
ffmpeginstalled:Then check if you have
ffprobe, if not:pydub needs ffmpeg to work correctly.
lastly, download
pydub:Then run the code you have, or this sample code:
I hope this helps!