Replit audio not working
I'm trying to make a python program, and I want notifications to work, and I'm using the replit audio API (I have explorer turned on)
and I try this bit of code:
I run it, then suddenly I get an error.
Traceback (most recent call last): File "main.py", line 9, in <module> audio.play_file('tarzan-screaming.wav') File "/opt/virtualenvs/python3/lib/python3.8/site-packages/replit/audio/__init__.py", line 293, in play_file return self.__get_new_source(name, does_loop) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/replit/audio/__init__.py", line 237, in __get_new_source raise TimeoutError("Source was not created within 2 seconds.") TimeoutError: Source was not created within 2 seconds.
I don't know what I'm doing wrong, please help.
Your audio file is empty, thus there is nothing to play. It shoud run correctly after you fix it
TimeoutError. You get that if your music file is too long or nothing. For this case, it seems your music file has nothing in it.
that's probably the cause of the error.