Playing audio in Python
Exactly what it sounds like. I know that I need audio from replit, but after that I'm kinda confused on what to do.
(I won't ping them) answered you question but keep in mind that
Replit audio in python does not work for people viewing your projects
Because they are so new, spotlight pages can't play audio yet. So if you want to post it on the
Apps page or if you want to share it with someone, instead of hearing the wonderful audio file, they will see an anoying error that stops the program
Its all in the Docs.
First import replit and make sure to upload the sound file as .mp3 or .wav . Type this code:
from replit import audio import time audio.play_file("download.mp3") time.sleep(10)
time.sleep in the end is there because once the file is executed, repl abruptly stops. So it is there so that the audio can run.