Problem description:
Replit audio has a meltdown when the owner isn’t using it
Expected behavior:
Replit audio to work
Actual behavior:
It has a complete mental breakdown if im not using it
Steps to reproduce:
Paste the following code into your own replit and try it on your testing account…
Code:
make sure you have a file named “notif.mp3”
from replit import audio
from time import sleep
audio.play_file("notif.mp3")
sleep(0.5)
Browser/OS/Device:
Firefox/Chrome / Windows 11 / PC
btw, error is:
Traceback (most recent call last):
File "main.py", line 3, in <module>
audio.play_file("notif.mp3")
File "/home/runner/BdqRSvINGyE/venv/lib/python3.10/site-packages/replit/audio/__init__.py", line 294, in play_file
return self.__get_new_source(name, does_loop)
File "/home/runner/BdqRSvINGyE/venv/lib/python3.10/site-packages/replit/audio/__init__.py", line 230, in __get_new_source
sources = AudioStatus(self.read_status())["Sources"]
File "/home/runner/BdqRSvINGyE/venv/lib/python3.10/site-packages/replit/audio/__init__.py", line 382, in read_status
with open("/tmp/audioStatus.json", "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/audioStatus.json'
Replit audio is known to not work very well, and when it does work it only works in your dev environment. So I don’t think it would work on the cover page.
I wasn’t able to reproduce this issue. I created a new Repl and added an mp3 file. I then ran the Repl, it asked me for permission to play the audio, and it worked fine.