Thread: Something Like beep()

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    417

    Something Like beep()

    I just realized today why I can't use beep() on my XP machine: I have NO PC speaker whatsover.

    Is there any way to send tones to external speakers through the sound card, or would I have to use wavs?

  2. #2
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    MIDI

    Look-up the MIDI functions (Maybe DirectX too). MIDI was originally conceived as a way to hook-up a synthesizer to a computer. Basically, the computer sends the set-up commands to the synth (or sound card) and then just sends the notes. (Actually, a bit more info… like how hard the key is struck, how long its held down, etc.) This takes the load off of the CPU… The CPU is sending notes at the same rate that a musician would read them (slow for a computer). When you play a wave file the CPU sends tens-of-thousands of samples per second (depending on the sampling rate and if stereo or mono) in a continuous stream from the hard drive (or memory).

    The MIDI functions are not ANSI C++, of course. But, they are part of windows, and support is included as part of the MSVC++ library.

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    http://cboard.cprogramming.com/showt...941#post230941

    Ah, the old "no speaker ploy"...

    PlaySound() is easy. DirectX is more powerful.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    417
    Yeah, that was me. I don't have a PC Speaker, but I thought I did. The stupid compaq computers in my house don't have them.

    So there is no simple function to do the equivalent to beep() with external speakers instead of the pc speaker?

    I don't want to learn directx because this is a console app, not the kind that would be recognized as a windows program (I know its still windows...)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. beep when even?
    By Ahmed29 in forum C++ Programming
    Replies: 7
    Last Post: 11-07-2008, 05:14 AM
  2. linux beep function
    By Calef13 in forum C++ Programming
    Replies: 7
    Last Post: 07-14-2007, 01:39 AM
  3. 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
  4. alert beep sound
    By bazzano in forum C Programming
    Replies: 3
    Last Post: 02-14-2006, 02:24 PM
  5. Beep();
    By SirCrono6 in forum C++ Programming
    Replies: 7
    Last Post: 02-22-2004, 04:47 PM