Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making Noise with Python

I am trying to get python to make noise when certain things happen. Preferably, i would like to play music of some kind, however some kind of distinctive beeping would be sufficient, like an electronic timer going off. I have thus far only been able to make the system speaker chime using pywin32's Beep, however this simply does not have the volume for my application.

Any ideas on how I can do this?

EDIT: I have been using PyAudiere for this, but unfortunately the package has been abandoned. Now I need an alternative.

like image 873
Elliot Avatar asked Jun 04 '26 11:06

Elliot


2 Answers

For cross-platform perfection and maximum flexibility, you could use pygame.mixer.

like image 122
Alex Martelli Avatar answered Jun 07 '26 00:06

Alex Martelli


For windows, you can use the winsound standard library: http://docs.python.org/library/winsound.html

like image 31
Amber Avatar answered Jun 07 '26 01:06

Amber



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!