I find myself facing a wall here, just trying to load an audio file into pydub to convert it, it keeps throwing the error "[Errno 2] No such file or directory".
Naturally, I spent too much time making sure that the paths are valid, tried relative and absolute paths, and confirmed that the python open () method works fine with the same path as it is.
I am working in ipython 3.2 with python 2.7 through the anaconda 2.3 distribution on ubuntu.
from pydub import AudioSegment
sound = AudioSegment.from_mp3("/absolute/path/to/file.mp3")
Also tried without spaces in the way, as this is sometimes a problem. Here is the complete error log:
OSError Traceback (most recent call last)
<ipython-input-15-8b1ec013ca8e> in <module>()
1 import pydub
/home/ludo/anaconda3/envs/python2/lib/python2.7/site-packages/pydub/audio_segment.pyc in from_mp3(cls, file)
421 @classmethod
422 def from_mp3(cls, file):
424
425 @classmethod
/home/ludo/anaconda3/envs/python2/lib/python2.7/site-packages/pydub/audio_segment.pyc in from_file(cls, file, format, **kwargs)
404 log_conversion(conversion_command)
405
407 p_out, p_err = p.communicate()
408
/home/ludo/anaconda3/envs/python2/lib/python2.7/subprocess.pyc in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
708 p2cread, p2cwrite,
709 c2pread, c2pwrite,
711 except Exception:
712
/home/ludo/anaconda3/envs/python2/lib/python2.7/subprocess.pyc in _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, to_close, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite)
1333 raise
1334 child_exception = pickle.loads(data)
-> 1335 raise child_exception
1336
1337
OSError: [Errno 2] No such file or directory
Am I blind to something really simple or ...?
:
r "/absolute/path/to/file.mp3", Vaulstein, - .