Archived

This topic is now archived and is closed to further replies.

Ridcully

How to beep with the PC Speaker?

Recommended Posts

How can i emit a signal from the PC Speaker under a Win32 platform? There doesn''t seem to be an appropiate API function (at least i didn''t find one). I cannot use the normal sound system because that could be captured by fullscreen apps. So I thought using the PC Speaker would be a good idea because it should always be avaible... Any suggestions? thanks ridcully

Share this post


Link to post
Share on other sites
Well, there''s the Beep(DWORD dwFreq, DWORD dwDuration); command, but that doesn''t work in Win95 and I''m not sure if it would be happy with exclusive mode.

I seem to recall that there was a control character you could use to produce a system beep, I think it was \a or possibly \g. I can''t find anything on it tho. It''s supposed to be a native C/C++ escape sequence for alerts, but I don''t know that it was retained in Windows. Try using a cout with one of those and see if it works.

Personally I try not to put my sound library in exclusive mode. It''s usually happy in normal mode.

Tell me if one of those works, I''m curious.

-fel

Share this post


Link to post
Share on other sites
no, it''s a pity but it doesn''t seem to work.

my intent is to emit any kind of signal to the user while he is playing a fullscreen game (that has captured both sound and video in exclusive mode).
can you think of any other way to do that?

Share this post


Link to post
Share on other sites
Hmm. Well, I''m out of ideas. I don''t know the assembly commands to make stuff beep, and even that would probably be processed through the sound card first and therefore get lost.

It kind of surprises me that you''ve found a game with that problem... even Everquest, which locks you out of alt-tab, is in normal mode and allows sounds from other apps to get through.

Share this post


Link to post
Share on other sites