Python has not supported sound for quite a while now.
Are the developers planning to add sound?
When will this happen?
Will this even happen?
sound with python on replit doesn't work. I mean, when you run something with sound It will sometimes play and other times it won't. The tnkter module is also unavailable so you can't use that either. The playsound module gives an error when you try to download the package. os.system also doesn't work for some reason whatsoever. there is a way, I forgot how, where you can play a .wav audio file and it plays without an error but you can't hear it. So basically all in all you can't play audio with python on replit. I'm pretty sure you can do it with Py.Charm because you can use the tnkiter module.
You've already received two good answers, though I'd just like to clarify: Python does not have a built-in sound library, and I doubt they will add one due to the issues with compatibility. Python has third-party libraries made by the community to support sound, some dedicated (such as
simpleaudio) which you can install from PyPi. Replit, however, runs your code remotely on a container in their servers, so any sound produced would not get to you, in the browser, if it was even produced. To combat this, Replit has created an API for playing sound, which allows you to bypass this and get Replit to play the sound directly in the browser. You can do this quite easily with the
replit module; see Bookie0's answer.
There's already sound in Python, use repl.it audio. Check this out for the full blog.
You'll probably need to be an explorer for that. To be an explorer, go to account:
And scroll down to roles and check 'explorer':
from replit import audio # imports library # replace audio_file.mp3 with the actual file # you can use .mp3, .wav, and .aiff source = audio.play_file("audio_file.mp3")
Good luck and have fun! :D