A way to generate beep through sound card

I would like to generate a beep sound (for example a sine wave sound) with a particular frequency (Hz) and length (ms). How can this be accomplished with VB.net? Rather than using pc speaker, I would like to use DirectSound or so...
[245 byte] By [reinfecta] at [2007-12-25]
# 1

Look at the VB.NET samples on TheZbuffer.com, I think you will find a sample there. Alternatively, you can convert the PlaySound sample from the DirectX SDK into VB.NET.

DavidWeller-MSFT at 2007-10-8 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...
# 2
Thanks, but I can't find an example on TheZBuffer.com. I searched and searched...

I found this piece of code:
http://www.codeproject.com/csharp/messagebeep.asp

It seems to do the job, but how to extract only the generate beep part and convert it to Vb.net? I'm just a newbie programmer, so if anyone can do this, I would be most grateful!
So I need just the function to play a beep with frequency X and length of Y milliseconds.

reinfecta at 2007-10-8 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...