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?
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?
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.
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.
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...)