I'm trying to write a simple sound engine, and it needs to be able to play tones of a specific frequency and duration. I know the API function Beep() can do this but it has three problems:
1) The program halts until the tone is done.
2) It uses the PC speaker instead of the sound card.
3) Only one tone can be played at a time, even if called by two separate programs.
I need a way to play up to four different tones at once, through the sound card, without pausing the program. (No, I can't just use WAVs. The tones are generated on the fly.) I have looked at DirectSound but could not find such a function, plus I have seen this done without DirectX installed. How can I do this?
Alright, that worked good, but when I try to use the .GetVolume() function, I get automation errors, and when I try to use .SetVolume() I get 'Invalid Procedure Call or Argument' no matter what I pass to it. I need one sound to be significantly louder than the other, or they sound distorted. O_o What's the proper way to set the volume? (I'm pretty new to DirectX. Never really used it before.)