Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I make my project make noise or make a ringing noise?

I was making a timer and I wanted it to like make noise, ring when time was up.

Does anyone know how to have it ring? I simply want it to make a high pitched sound, for about 5 seconds and I already know how to make it repeat, if I can make the noise first.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You need external libraries/modules to play sound in Python[1]. The following links to resources and tutorials should provide some useful libraries get you started:

To install a Python library, you need to install pip (a Python package manager) first. See the pip docs on installation procedure.

Once you’ve install pip, you can simply run pip install whatever-sound-library to install a library. Then, assuming that you are using the right Python interpreter, you should be able to import the library and start using it.

See this article for examples on common external Python libaries.

Edit:

Since you mentioned that you’re using replit, you can refer to the replit docs on how to install Python packages

[1] Well, it’s not required per se, however because each operating system has its own API for sound, implementing a sound player yourself would be tedious (since you have to tailor to each OS) and not portable most of the time.

[2] Possible duplicate question?

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading