I need to find out (programmatically) whether the installed sound card supports duplex operation (i.e. recording and playing back simultaneously). I realise that most modern cards do support this but I still need to check.
I've discovered that waveInGetDevCaps() and waveOutGetDevCaps() will give me information about individual inputs & outputs but I can't find anything to tell me if the card supports duplex operation. In fact I can't even find anything to tell me the name of the sound card (although the above functions do tell me the names of the various inputs & outputs). I thought this would be supported in mmsystem.h and winmm.dll but I guess I must be looking in the wrong place. Can anyone point me in the right direction?
"A problem well stated is a problem half solved.” - Charles F. Kettering
but although my email client (Outlook Express) looks like it can join me to news groups, I can't seem to join this particular one (Outlook Express keeps saying that it can't connect to the server). Is there something wrong with that URL or do I need to use a different kind of app to connect to a news service?
"A problem well stated is a problem half solved.” - Charles F. Kettering
but although my email client (Outlook Express) looks like it can join me to news groups, I can't seem to join this particular one (Outlook Express keeps saying that it can't connect to the server). Is there something wrong with that URL or do I need to use a different kind of app to connect to a news service?
You can browse the newsgroup with you web browser by going to the following address:
The answer had indeed been given several years ago on Win32 api newsgroup
It's the reference for Win32 api, in particular undocumented ones never seen elsewhere and for source code for all the Win32 80 000 apis (from Wine and other...),
like Codeguru is the reference for MFC.
MS newsgroups are not bad also, for Kernel and DDK, but newer, then archives are not huge like for Usenet....
Last edited by Laurentis; January 13th, 2009 at 05:48 AM.
Thanks for persevering guys. I must admit, I'm struggling to find an API that will just give me the name of the installed sound card(s). Arjay's WMI SoundDevice class looked promising but I couldn't find a clear example of using it.
Any more ideas ?
"A problem well stated is a problem half solved.” - Charles F. Kettering
Thanks Codeplug. I haven't tried your second link yet but I copied the code from your first link and it kinda worked. I ran the full program and it produced the output [MPU-401 Compatible MIDI Device] which is indeed listed by Device Manager under Sound,Video and Game Controllers. Strangely though, it didn't list my actual sound card which is shown in Device manager as RME HDSP 9632.
I've tried a few variations on the same theme (i.e. sending different GUID's to your function ListDeviceClassData(..) but I can't find anything that lists my actual sound card. Any ideas?
"A problem well stated is a problem half solved.” - Charles F. Kettering
Here's a WMI C++ example (see the attached file for complete source). The sample retrieves processor, sound card and memory information.
FYI: One of the hardest things with using WMI is to determine which class and properties are available. To help with this, download the WMI Administrative Tools and use the WMI CIM Studio Tool to view the class and property information.
Processor:
Description x86 Family 6 Model 14 Stepping 8
Manufacturer GenuineIntel
ProcessorId BFE9FBFF000006E8
Current Clock Speed 1830
Max Clock Speed 1830
L2 Cache Size 2048
Thanks very much for the ideas guys. Codeplug - your suggestion works perfectly on my laptop machine but for reasons I can't understand, it doesn't find the sound card on my desktop machine The only thing I can think is that the sound card might be registered as a different kind of device (i.e. something other than an audio device). Is there a GUID that will simply list all the devices, regardless of their type?
Arjay - your code definitely looks promising. After commenting out a few lines (see below) I've been able to run it in my debugger and it successfully lists RME HDSP 9632 which is my sound card !!!
But there's a problem.... I'm compiling under VC++6. Your file WMIHelper.h contains a couple of functions that look something like this:-
VC++ 6 won't let me convert an object of CComVariant into a CString. Can you think of a way to convert it to some other kind of string (e.g. std::string) ?
"A problem well stated is a problem half solved.” - Charles F. Kettering
If you are going to use std::string, I'd recommend defining it as 'Tstring' so if you compile for ANSI now and decide to port the code to UNICODE later, the code will continue to work.
I guess this must be something that changed very subtlely sometime after VC++6 since most of my other attempts resulted in C2440: 'type cast' : cannot convert from 'class ATL::CComVariant' to 'unsigned short *'. Still, I got there in the end.
"A problem well stated is a problem half solved.” - Charles F. Kettering
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.