Beep

This is a discussion on Beep within the C++ Programming forums, part of the General Programming Boards category; If you have a sound card installed, and you use Beep(), it sends something to the sound card, not the ...

  1. #16
    Registered User
    Join Date
    Sep 2002
    Posts
    417
    If you have a sound card installed, and you use Beep(), it sends something to the sound card, not the PC speaker, correct?

    Is there any way to override this so that it sends it to the PC speaker no matter what?

    I'm using MVC++ 6.0 and Windows XP. And yes, I have a sound card.

    Thanks!

  2. #17
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Is there any way to override this so that it sends it to the PC speaker no matter what?
    You might post that question to the windows board (just ask 'em if there's a function to make windows think there's no sound card, so you don't confuse them with all this internal speaker stuff.)

    The problem here, as you probably know, is that the "decision" as to whether to use the internal or external speakers is being made outside of your program by the OS when it receives the "Beep" command from your program.

    Actually, I didn't understand that default sound stuff either. I sort-of assumed that it would play the default if you had a sound card AND if you left the parameters blank.

    BTW - My preliminary research found that there are MIDI functions built into the Windows API. But, they (Microsoft) are really pushing Direct-X for this purpose. For the MIDI stuff you HAVE to use a sound card.

    And you thought making some simple sounds from the PC speaker was going to be easy!

  3. #18
    Registered User
    Join Date
    Sep 2002
    Posts
    417
    Heh. It works on the 2k machine I was working on because that doesn't have a sound card. I'd do what you said, only what I'm doing is a console program.

  4. #19
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    I'd do what you said, only what I'm doing is a console program.
    Yeah, you'll probably get flamed... But, I'm 90% sure that you'll have to use the WinAPI to fake-out the Windows operating system.

    [OPINION WARNING!]
    The "right" way to do this (if it were a commercial program) would be to write a device driver. But, writing Windows device drivers is NOT trivial... 'Still on my "Things To Learn" list. The usual sequence is: First learn C++. Second, learn to program the Windows user interface. Third, learn some Assembly, and drivers programming.

    [OFF-TOPIC WARNING!]
    Thanks to Stan100 and Trouts for giving me a great idea!!!
    I had been thinking about learning to write drivers. The barrier to writing a driver "at home" is that you need to know how to communicate with a device and the device manufacturer's don't generally publish this info. For example printer manufacturer's no longer include in their user manuals the escape-sequences required to change to "bold". However, I CAN find the information about to communicate with the PC Speaker. I think this would make a great first-driver project... If I ever advance to that point.

  5. #20
    Registered User
    Join Date
    Sep 2002
    Posts
    417
    I'd love that driver... there are 2 I've seen that you have to pay for, and I don't want to pay for that. One is free, I'll try it when I get home...

    http://www.programmersheaven.com/zon...t610/25290.htm

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. linux beep function
    By Calef13 in forum C++ Programming
    Replies: 7
    Last Post: 07-14-2007, 02:39 AM
  2. I need to play a pre recorded vox file using C
    By m.sudhakar in forum C Programming
    Replies: 4
    Last Post: 11-17-2006, 06:59 PM
  3. alert beep sound
    By bazzano in forum C Programming
    Replies: 3
    Last Post: 02-14-2006, 02:24 PM
  4. Beep();
    By SirCrono6 in forum C++ Programming
    Replies: 7
    Last Post: 02-22-2004, 04:47 PM
  5. Something Like beep()
    By Trauts in forum C++ Programming
    Replies: 3
    Last Post: 02-02-2003, 02:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21