I want to output a defined frequency and volume to the speakers, how do I do this with out using DirectSound?
I want to output a defined frequency and volume to the speakers, how do I do this with out using DirectSound?
You can use the BEEP command
Unfortunately this is really low tech and doesn't utilize the sound card, so use it as a last resort.Code:#include <iostream> #include <windows.h> using namespace std; int A = 440; int main() { cout<<"This is a concert A: "<<A<<"Hz"; Beep(A, 5000); cin.get(); return 0; }
-JM
Huh?
I'm well aquaintied with the Beep() function. The problem is you don't have control of the volume of the output, only the frequency.
How do you feel about winmm? waveOut[*] Functions?
Why don't you read about them? Was that an off-hand comment suggesting that you would go read about it, or an invitation for some poor fool to explain how to use this library with plenty of existing documentation?
There some MIDI functions in the Windows API. A few years ago, I was able to write a short MIDI program from the information on this web site.
I'm sure there's some some help at MSDN... if you know what to look for... if you can find it... Try searching MSDN for this function:
midiOutShortMsg()
I assume that these "standard" MIDI functions are "obsolete" and replaced by their DirectX equivalents.
Thanks, that is a good link, but I guess DirectSound/DirectX is the way to go, there is really no reason not to go with it.