-
Notifications
You must be signed in to change notification settings - Fork 249
Description
I am trying to convert mp3 file to wav file using python!
CODE:
from os import path
from pydub import AudioSegment
files
src = "the_audio.mp3"
dst = "test.wav"
convert wav to mp3
sound = AudioSegment.from_mp3(src)
sound.export(dst, format="wav")
Error:
FileNotFoundError Traceback (most recent call last)
in
1 # convert wav to mp3
----> 2 sound = AudioSegment.from_mp3(src)
3 sound.export(dst, format="wav")
~\anaconda3\lib\site-packages\pydub\audio_segment.py in from_mp3(cls, file, parameters)
736 @classmethod
737 def from_mp3(cls, file, parameters=None):
--> 738 return cls.from_file(file, 'mp3', parameters=parameters)
739
740 @classmethod
~\anaconda3\lib\site-packages\pydub\audio_segment.py in from_file(cls, file, format, codec, parameters, **kwargs)
683 info = None
684 else:
--> 685 info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
686 if info:
687 audio_streams = [x for x in info['streams']
~\anaconda3\lib\site-packages\pydub\utils.py in mediainfo_json(filepath, read_ahead_limit)
272
273 command = [prober, '-of', 'json'] + command_args
--> 274 res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
275 output, stderr = res.communicate(input=stdin_data)
276 output = output.decode("utf-8", 'ignore')
~\anaconda3\lib\subprocess.py in init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
798 c2pread, c2pwrite,
799 errread, errwrite,
--> 800 restore_signals, start_new_session)
801 except:
802 # Cleanup if the child failed starting.
~\anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
1205 env,
1206 os.fspath(cwd) if cwd is not None else None,
-> 1207 startupinfo)
1208 finally:
1209 # Child is launched. Close the parent's copy of those pipe
FileNotFoundError: [WinError 2] The system cannot find the file specified