Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't get winsound.Beep to work

Tags:

python

I am trying to make some Beep noises with the winsound.Beep command. However when I am using winsound.Beep(500, 500) I do not hear anything. With winsound.MessageBeep and winsound.PlaySound however, I DO get to play sounds. Any ideas what I should do?

What I am trying to do: I want to write a little practicing program for training intervals: the computer sounds a first tone, then a second tone and you will have to guess what the tone interval is. For this I need pitched tones, tones for which I can set the frequency. I want to keep it as simple as possible, any pitched sound will do. I do not want to have to collect a set of .wav files or whatever. I want to make use of a tone generator which I think is available on most soundcards. winsound.Beep seems like something that can do this trick, but any other suggestions are welcome.

like image 445
Django Avatar asked Jan 13 '13 14:01

Django


2 Answers

I had the exact same problem. winsound.Beep used to work just fine and then it suddenly stopped working (or that's what I thought). The problem was that someone (or some update) had turned off the System sounds, which prevented windows from playing the Beep sound, either manually or through my program. Try right clicking on the Speaker symbol, Open volume mixer and check whether System sounds is off or minimum volume.

I hope that helps!

like image 99
YoungResearcher Avatar answered Oct 03 '22 19:10

YoungResearcher


Are you sure that your computer has a beep? A lot of recent computer remove the beep because it was annoying and most computer today have soundcard to play wav sound instead (the other sound that you are able to play).

You can also check to validate if it's activated on this page

IMO, I think that using the beep for other things than debugging is not a good idea.

EDIT

Mayby you can try this code to create a sound using a base wav with synth algorythm

like image 36
Jean-François Côté Avatar answered Oct 03 '22 19:10

Jean-François Côté