I have been months trying to figure out what program was causing those strange beeps. It was the same sound as when a popup message appears, but I couldn't find such message from any open application. I JUST found I had the 'beep on update' checkbox set on the BOINC stats widget!
Could you use a custom sound instead of calling beep()? It would cause less confusion since users would know what caused the sound...