Если ввести путь в поиск проводника, то файл открывается, но python его не видит. Почему?
from pydub import AudioSegment
import os
def convert_opus_to_wav(opus_file, wav_file):
AudioSegment.converter = f"{os.getcwd()}\\ffmpeg.exe"
AudioSegment.ffprobe = f"{os.getcwd()}\\ffprobe.exe"
# Загрузка файла opus
audio = AudioSegment.from_file(opus_file, format="opus")
# Экспорт файла в формате wav
audio.export(wav_file, format="wav")
# Пример использования
opus_file = r"C:\Users\comin\OneDrive\Рабочий стол\es/my.opus" # Путь к файлу opus
wav_file = "output.wav" # Путь для сохранения файла wav
convert_opus_to_wav(opus_file, wav_file)
B:\es>python main.py
B:\Programs\anaconda3\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
B:\Programs\anaconda3\lib\site-packages\pydub\utils.py:198: RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work
warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)
Traceback (most recent call last):
File "B:\es\main.py", line 17, in <module>
convert_opus_to_wav(opus_file, wav_file)
File "B:\es\main.py", line 8, in convert_opus_to_wav
audio = AudioSegment.from_file(opus_file, format="opus")
File "B:\Programs\anaconda3\lib\site-packages\pydub\audio_segment.py", line 728, in from_file
info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
File "B:\Programs\anaconda3\lib\site-packages\pydub\utils.py", line 274, in mediainfo_json
res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
File "B:\Programs\anaconda3\lib\subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "B:\Programs\anaconda3\lib\subprocess.py", line 1440, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Не удается найти указанный файл