Using only the modules that come with a standard python 2.6 installation, would it be possible to play a simple beeping noise?
24
votes
See: stackoverflow.com/questions/13941/python-sound-bell
- perimosocordiae
So I would have to go through the default os's speech to text program? Also I am not using a mac all of the time. This would have to be cross platform.
- a sandwhich
@a sandwhich: Read the answers at the link, not the question.
- Greg Hewgill
3 Answers
34
votes
18
votes
On windows:
import winsound # for sound
import time # for sleep
winsound.Beep(440, 250) # frequency, duration
time.sleep(0.25) # in seconds (0.25 is 250ms)
winsound.Beep(600, 250)
time.sleep(0.25)
34.4. winsound — Sound-playing interface for Windows:
http://docs.python.org/2.6/search.html?q=sound&check_keywords=yes&area=default
See also: Clear screen and beep for various platforms. (Python recipe) http://code.activestate.com/recipes/577588-clear-screen-and-beep-for-various-platforms/