Serge Wautier
Serge Wautier

Reputation: 21878

Audio: How to set the level of the default microphone?

This one makes me crazy:

On a Vista+ computer dedicated to this sound playing/recording application, I need my application to make sure the (default) microphone level is pushed to the max. How do I that?

I found the Core Audio lib, found how to get an IMMDevice to the default microphone. Now what?

Docs lead me to think that I need an ISimpleAudioVolume interface pointer from my IMMDevice, but how do I do that?

Note that I'm interested in any programmatic way to set this micro level (whether Core Audio or anything else). Ideally system-wide, but application-wide is ok.

TIA,

Upvotes: 0

Views: 2294

Answers (1)

Serge Wautier
Serge Wautier

Reputation: 21878

The trick is that in Core Audio, recording (aka capture) and rendering devices are not considered different (as long as you don't dive too deep of course), as opposed to former APIs such as waveXXX where there are different APIs for input and output devices.

Therefore, this full example by Larry Osterman that sets the speaker volume can be modified to set the microphone volume by simply changing eRender to eCapture in the enumerator call that returns the default device.

Thanks Larry!

Upvotes: 1

Related Questions