Recording sound using .net and DirectSound

Can anyone point me towards some good tutorials (pref. in vb.net) or provide me with some sample code on how to record sound in my application using DirectSound?
LVL 7
garethh86Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nomooseCommented:
Hey Garethh86,

I think this site is a great place to get started!

http://www.freevbcode.com/showcode.asp?id=1082

Hope it helps,
Elliot
0
garethh86Author Commented:
Not only is that tuturial in vb6 not .net as requested, it also doesn't cover anything to do with recording, only playing sound.
0
nomooseCommented:
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

garethh86Author Commented:
That is only to do with playback of sound NOT recording.

Seriously, I can use google - I'm asking here because I can't find anything of worth.

I need sample code, preferably in VB.net, will manage with C# though, describing how to RECORD sound using DirectSound.

Thanks.
0
nomooseCommented:
I'm not sure if you've come across this, but MSDN has a lot of literature on DirectSound.  If you search there you can find the following:
"Capturing Waveforms"
http://msdn.microsoft.com/en-us/library/ms804985.aspx

All of those articles are pieces of the whole picture.  They all provide code and thorough explanation.  The code is available in a variety of languages, you just have to click on the links for the definitions in the articles for it to take you to the code.

From what I can tell with this you should be able to record sound from a mic or other audio devices in the computer as long as you set up the device object.

- Elliot
0
garethh86Author Commented:
That still doesn't help me, I've already been through the documentation, I need sample code please, starting from the beginning (init directsound, capturing the sound) to the end (formatting the captured audio and saving it to disk.)
0
garethh86Author Commented:
Turns out this can only be done using 'stereo mix' or 'what you hear' which is only supported by certain sound cards.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Game Programming

From novice to tech pro — start learning today.