I am writing a program which should output some frequency shift keyed (FSK) audio. I am using a sin(...) function to find some values to plug into an array of unsigned ints which I am outputting using waveOutWrite with a sample rate of 44100 specified in the header.
The values are all good and follow a sinusoidal wave, but looking at the output on the scope when I play the buffer shows a general sine wave shape with the frequency I want but it's a complex wave that's bouncing up and down with another sine-looking wave along the first wave.
When I specify a sample rate of 96000 in the header, it seems to look fine, but no other values seem to work. The Realtek 662 chip it's outputting from specifies that it can handle up to 96kHz, but the MSDN docs for WAVEOUTCAPS only shows 44.1kHz as the highest sample rate.
Playing pre-made wave files, even one that I bugged in the values from my buffer to, using PlaySound(...) looks nice and smooth on the scope, but if I play the 1.92ms duration wave files in succession to create the FSK it doesn't make a continuous wave like I need so it sounds like a bunch of blips (from the speaker kicking on and off?).
Any ideas why waveOutWrite makes the bad waveform or otherwise how to solve this problem? How can I play my buffer with a smooth sine wave?
Alternatively, I'm creating a string of binary bits that would need output as 1.92ms of frequency A for 0 bits and 1.92ms of frequency B for 1 bits. Other ideas on how to do that if what I'm doing above isn't the best way would also be appreciated.