A hard question on matching up mixer device names with multimedia options

I have only 80 points, that makes a "poor" guy ask only "easy" questions :-)

I am working on a multimedia program.

In the program I show some mixer controls for recording/playback. However, when there are multiple mixer devices in the system, I want to show the mixer controls for the current user selected recording/playback devices.

Here is an example, I have two mixer devices, the mixer API mixerGetDevCaps()lists them as

1. ESS AudioDrive Mixer
2. Videum Audio Mixer(0)

Under System/Setting/Multimedia Properties/Audio user can also choose Playback or Recording devices, they are listed as:

Playback, Prefered device:
1. ESS AudioDrive Playback
2. Winnov Videum Wave Playback

Recording, Prefered device:
1. ESS AudioDrive Record
2. Winnov Videum Wave Record

If the user selects ESS AudioDrive Playback, then I need to show speaker volume for mixer ESS AudioDrive Mixer. Same for the recording.

I  figured out that when you click on System/Setting/Multimedia Properties/Audio/Playback or Recording, the selected Playback/recording devices are stored in the registry under CU/software/microsoft/multimedia/sound mapper.

However, I cannot match up the Playback/Recording device names with the mixer device names returned by mixerGetDevCaps() API.

P.S. I also tried to enumerate thru the CLSID_AudioInputDeviceCategory device list. It didn't help, because the list differs from mixerGetDevCaps()API, and the order of the devices also changes based on the user's current selection.

Any help is appreciated.


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.

ymengAuthor Commented:
Edited text of question.
ymengAuthor Commented:
Adjusted points to 80
For playback, the device names are returned by waveOutGetDevCaps. For recording, they are returned by waveInGetDevCaps. Try matching the wMid and wPid instead of the name.

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
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

ymengAuthor Commented:
Thanks for the reply.

waveInGetDevCaps() and waveOutGetDevCaps() both return names that match the device names shown in the control panel/Multimedia Properties/Audio section.

However, this is what gets me frustrated: I tested 2 different devices (ESS sound card, and logitech camera) on win98. They both returned the same wMid = 1 (which happens to be Microsoft's wMid.) Although some other devices do return wMid truthfuly.

I am wondering if I am hitting a dead end trying to solve the problem this way.

Let me provide a scenario of what I was trying to achieve (I'll use playback as example only)

1. I read from registry to figure out the user selected playback device (e.g. "ESS AudioDrive Playback", so I need to show the volume control from the ESS mixer in my program)

2. I query mixers using mixerGetDevCaps() (e.g. I got 2 devices "ESS Audio Mixer" and "Logitech Cam Mixer")

3. Based on the names I know "ESS Audio Mixer" is the right mixer. However computer can't use those names to match the them, 'cause the strings are not identical.

So I use waveOutGetDevCaps() to query the playback devices, both devices return the same bogus wMid. I still can't pick the right mixer using wMid.

The only other way I know is to use "fuzzy" logic to match "ESS AuioDrive Playback" with "ESS Audio Mixer(1)". This can be ugly: how do I match "Winnov Videum Playback" with "Videum Audio Mixer(1)" ?

Any new idea is greatly appreciated.


Based on my observation, the order of the wave out devices is the same as the order of the mixer devices. For example, if "ESS AudioDrive Playback" is the device with ID 0, its corresponding mixer device ID should be 0 as well. But I am not 100% sure.

ymengAuthor Commented:
Thanks for your reply again.

I used that assumption before and it didn't work well.

Here is a nasty example: I have an ESS Audio Card, and a logitech camera with a built-in mic. The system counts that as 2 mixers. However, the camera only supports wave-in not wave out, so I've got 2 mixers, but only one wave-out, the index based scheme didn't work in this case.

I appreciate your help.

I am thinking to use some ad-hoc rules to match the names, though I'd really like to find another solution.


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
System Programming

From novice to tech pro — start learning today.