Skip to content
← Back to Community
sound
Profile icon
abheer

I want to ask that how we can give background sound to our game in python?

Voters
Profile icon
Bobzilla07
Profile icon
JayThompson1
Profile icon
shamat
Profile icon
AydenFermin
Profile icon
BeloRune
Profile icon
Hidere0225
Profile icon
TheLumine
Profile icon
bendavis
Profile icon
tox123
Profile icon
abheer
Comments
hotnewtop
Profile icon
msaunby

A simple beep is possible in Python, and other languages, by printing an ascii bell character.
print("\a") or print("\7") will do this. A few of these with a short sleep() between them can be useful.

Profile icon
Aaryan0405

@msaunby i did while true loop and did it undreneath. Sounded terrible

Profile icon
timmy_i_chen

Unfortunately sound doesn't work on Repl.it, since all your code runs on a virtual machine far away (it doesn't run on your local computer), and we don't pipe sound over to the terminal. :(

Profile icon
eventiger2018

@timmy_i_chen i was wondering why sound did not work!

Profile icon
Hidere0225

@timmy_i_chen I almost devoted my entire afternoon to try to create sound for my repl. Thanks so much bro!