I read Replit docs and tried to play a sound, that I already uploaded as another file in my repl(Click.mp3), but I get really strange error. What’s the problem is going on here?
Welcome to the forums! Could you please provide a link to the Repl?
Yes, of course. I first tried using this command in my main project, then got an error and did the same in a separate project. The situation was the same there, although I tried toggling the “Explorer” mode on and off. After surfing the forum I found several other similar situations that never got a solution. Is this a problem on the Replit side or are we just misunderstanding something? Link: https://replit.com/@BogdanMerlikov/Discord-bots-3?s=app
note that you can’t make replit audio work for accounts which don’t have edit access to the repl, or on Safari. Since all you’re using is a single click sound, see if the sound that this produces suits your purpose:
print("\a")
To make playing audio files work:
- Click Files ⋮ > Show hidden files,
.replit
- Add a line to the start
audio=true
oh wait, forgot you’re on a non-nix repl. I guess nix migrations don’t happen on mobile app yet.
Create a .replit
file.
One more thing! I tried to run it online at this webpage and code worked. This problem is happening only in replit app. But I want to found a way to play sounds and it app.
then re-run the code and if audio is supported in the mobile app, it should work
oh, run kill 1
in Shell then try