Skip to content
← Back to Community
Audio Not Working
Profile icon
SamKunefeh

I was just messing around with replit’s new feature and even got to the point where it was working. However now when I try to play this file, the sound doesn’t plays anymore. I also put it inside a while loop and asked for input, but it still didn’t worked. Am I doing something wrong? Because the file is even in the correct format: .mp3.

Answered by RYANTADIPARTHI [earned 5 cycles]
View Answer
Voters
Profile icon
wolfieboy09
Profile icon
dexah
Profile icon
SamKunefeh
Comments
hotnewtop
Profile icon
RYANTADIPARTHI

Solution

Your code should work. Maybe try these steps:

  • change the name of your file to sound.mp3
  • put that name in the play_file
  • put your stuff in a function

Your code should look like this:

from replit import audio def sound(): source = audio.play_file('sound.mp3') sound()

And you should have a file with the name of sound.mp3 Also. remove the while loop, and the time. when you remove them, run it, if it works. Put them back, and try again. Ping me if nothing works. But it should work though. Try it.

Profile icon
SamKunefeh

@RYANTADIPARTHI nope, still not working

Profile icon
RYANTADIPARTHI

@Jackbaklava if you tried all my steps, and it's still not working, then it's a bug. Maybe try refreshing, or making a new repl, if everything fails, report it to bugs. Click here

Profile icon
RYANTADIPARTHI

@Jackbaklava hey, did you try my other solution?

Profile icon
SamKunefeh

@RYANTADIPARTHI Yeah I did, but thanks for your help! I think it might be because I am running this in safari. I will run it again on a windows machine to see if it works.

Profile icon
RYANTADIPARTHI
Profile icon
SamKunefeh

@RYANTADIPARTHI Nope, still not working.

Profile icon
RYANTADIPARTHI

@Jackbaklava ok, if you uploaded a file and named it sound.mp3 then ran it. Then report it to bugs. Or maybe try removing the function.

Profile icon
SamKunefeh

@RYANTADIPARTHI Thanks for your help! I will definitely report it as a bug.

Profile icon
RYANTADIPARTHI

@Jackbaklava no problem :)