pydub audiosegement gives a FileNotFoundError

176 Views Asked by At

I'm trying to work with pydub to get the times of each word spoken in an audio file, but python throws me a FileNotFoundError

The code:

from pydub import AudioSegment
from pydub.silence import detect_nonsilent

path = "E:/PyApps/New/PythonApplication1/OSR_us_000_0010_8k.wav"
audio_segment = AudioSegment.from_wav(path)

The error:

Traceback (most recent call last): File "E:\PyApps\New\PythonApplication1\module1.py", line 5, in audio_segment = AudioSegment.from_wav(path) File "C:\Users\Dean\AppData\Local\Programs\Python\Python39\lib\site-packages\pydub\audio_segment.py", line 808, in from_wav return cls.from_file(file, 'wav', parameters=parameters) File "C:\Users\Dean\AppData\Local\Programs\Python\Python39\lib\site-packages\pydub\audio_segment.py", line 728, in from_file info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit) File "C:\Users\Dean\AppData\Local\Programs\Python\Python39\lib\site-packages\pydub\utils.py", line 274, in mediainfo_json res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE) File "C:\Users\Dean\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\Dean\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified

whats weird is that I've got all the files specified in the error in the right folder but it still can't find them for some reason.

0

There are 0 best solutions below