Traceback (most recent call last):
File "C:\Users\Oleg\PycharmProjects\Telegram_project\Telegram_voice.py", line 104, in <module>
bot.polling()
File "C:\Users\Oleg\PycharmProjects\Telegram_project\.venv\Lib\site-packages\telebot\__init__.py", line 1045, in polling
self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout,
File "C:\Users\Oleg\PycharmProjects\Telegram_project\.venv\Lib\site-packages\telebot\__init__.py", line 1120, in __threaded_polling
raise e
File "C:\Users\Oleg\PycharmProjects\Telegram_project\.venv\Lib\site-packages\telebot\__init__.py", line 1082, in __threaded_polling
self.worker_pool.raise_exceptions()
File "C:\Users\Oleg\PycharmProjects\Telegram_project\.venv\Lib\site-packages\telebot\util.py", line 147, in raise_exceptions
raise self.exception_info
File "C:\Users\Oleg\PycharmProjects\Telegram_project\.venv\Lib\site-packages\telebot\util.py", line 90, in run
task(*args, **kwargs)
File "C:\Users\Oleg\PycharmProjects\Telegram_project\.venv\Lib\site-packages\telebot\__init__.py", line 6793, in _run_middlewares_and_handler
result = handler['function'](message)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Oleg\PycharmProjects\Telegram_project\Telegram_voice.py", line 95, in transcript
text = recognize_speech(filename)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Oleg\PycharmProjects\Telegram_project\Telegram_voice.py", line 43, in recognize_speech
wav_filename = oga2wav(oga_filename)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Oleg\PycharmProjects\Telegram_project\Telegram_voice.py", line 36, in oga2wav
audio = Path(AudioSegment.from_file(filename))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Oleg\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 1162, in __init__
super().__init__(*args)
File "C:\Users\Oleg\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 373, in __init__
raise TypeError(
TypeError: argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'AudioSegment'
Process finished with exit code 1
в Pycharm тот же код раб в браузере: