Skip to main content
GameDev.net gamedev.net
🔒 Locked

[SlimDX / MDX / XAudio2?] - Best option for streaming Microphone Recording?

Started by peterg4000 Jun 24, 2010 at 7:42 AM 2 replies 4.5k views
Original Post
peterg4000
peterg4000
I am starting a new small project that needs to stream audio from a Microphone.

I would prefer to do it in C#.

I hear DirectSound and MDX are going obsolete.

So I found XAudio2 and SlimDX wrapping.
There is a SlimDX-XAudio2 'BasicAudio' example for playing audio (Which I think is a 'port' of a Microsoft XAudio2 sample...)
No SlimDX-DirectSound samples in the distro unfortunately.


Does XAudio2 and/or SlimDX have any microphone streaming support?


I can't find it in either, but I am not great at following the APIs yet...

All I want to do is some SIMPLE microphone input streaming using a modern Managed API.

Any pointers on a direction I should be heading would be appreciated.

All these APIs are a bit of a mine-field...
Ibasa
Ibasa
If your using SlimDX I think your best off using DirectSound. The only other way (AFAIK) of getting microphone input is the waveIn api which currently SlimDX doesn't wrap. And is quite a tricky api to wrap in a managed friendly way.
peterg4000
peterg4000
Thanks Ibasa, yes, I have been doing some more hunting around before bed and from the look of posts as recent as the last few month, it seems DirectSound is the way to go for Microphone input.
(Maybe I will get a "Hello Microphone World" app working in C++ first and then port to C#, as it appears I might even be breaking new ground using C#, SlimDX and microphone recording!)


It's annoying and confusing that MS tag something like DirectSound 'obsolete' but then leave fundamental features out of the latest APIs they are pushing.

I suppose I should stop assuming that MS decisions should make sense...
;-)
peterg4000
peterg4000

Well, after a few hours of looking, I seem to have hit 3 jackpots all of a sudden, just before bed time:

http://www.codeproject.com/KB/audio-video/cswavrec.aspx
http://naudio.codeplex.com/
http://crsouza.blogspot.com/2009/08/capturing-sound-from-microphone-using.html

It seems I spent too much time looking for XAudio-based 2 solutions...

There are solutions out there using C# with waveIn/waveOut, or via DirectSound (with or without SlimDX).
That'll teach me for trying to use the latest API standards I suppose... (I should have known better!)


I hope my summary here saves someone else like me a few hours one day!

Cheers.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.