У меня есть вот этот код:
import speech_recognition as sr
import pydub
def recognition(file_src, file_src2):
sound = pydub.AudioSegment.from_mp3(file_src)
sound.export(file_src2, format="wav")
sample_audio = sr.AudioFile(file_src2)
key = sr.recognize_google(sample_audio)
return key
print(recognition('audio5.mp3', 'test.wav'))
Но при запуске я получаю ошибку:
Traceback (most recent call last):
File "c:\Users\Дом\Desktop\Py\PY\e_garant_bot\audio_2_text.py", line 19, in <module>
print(recognition('captcha_audio5.mp3', 'test.wav'))
File "c:\Users\Дом\Desktop\Py\PY\e_garant_bot\audio_2_text.py", line 12, in recognition
sound = pydub.AudioSegment.from_mp3(file_src)
File "C:\Users\Дом\AppData\Local\Programs\Python\Python39\lib\site-packages\pydub\audio_segment.py", line 796, in from_mp3
return cls.from_file(file, 'mp3', parameters=parameters)
File "C:\Users\Дом\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\Дом\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\Дом\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Дом\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Не удается найти указанный файл
Что я делаю не так?