views:

89

answers:

2

Hi community,

I'm a bit confused. Is there any simple way to set proper audio devices (in/out) in my VoIP .NET application w/o using of DirectX?

"Proper audio devices" probably means - devices which are already set as DEFAULT in Windows.

E.g. Skype (or X-Lite) selects in most cases audio devices properly. But How? Just getting of list of devices don't solve the problem, cause I don't know how to select the proper one.

I suppose that solutions for XP and Vista(7) could be different.

Thank you in advance!

A: 

On Vista and Win7 you could use the MMDevice API IMMDeviceEnumerator::GetDefaultAudioEndpoint, and then use MMDevice::GetId to get the string describing this device.

On other systems (including Vista and Win7) you can use the older MME API waveInGetDevCaps and waveOutGetDevCaps using deviceID=WAVE_MAPPER (-1) to get the string describing the default device.

Han
Yeah, that's it! Thanks!
Dmitry Kadantsev
A: 

I've recently had to do something similar, but support multiple windows versions. I ended up using NAudio because of its simplicity. There are several example apps bundled in so you can see how to use it.

ZombieSheep
Thank you, your solution also could be used in some cases!
Dmitry Kadantsev