I want to play a tone while the key is held down and immediately stop when key is up. I have messed with the Beep API and it plays it through the PC internal speaker. I need a tone to play through the soundcard speakers.

The only way I know through the soundcard is a wav file but I need to adjust the length of how long is it played. It could be 1/2 a second, could be 1 full second for the tone to play.

Any suggestions?

Thanks!