Controlling (microphone) sound input level on Windows and Mac?

Perhaps slightly off-topic (unless Jules already thought about this and added it to Juce somewhere):

I would like to control the microphone's audio input level from within a standalone desktop application, a bit similar to what Skype does to help you set your microphone level correctly. For now, focus is on the built-in microphone on a laptop, or a simple USB microphone.

Of course you can do this manually from the system settings. This is what I tell people to do now:

  • on Windows7: Go to "Control Panel" --> "Sound" --> "Recording" and select "Microphone" --> "Properties". In the "Levels" tab, adjust the microphone input level.
  • on MacOSX: Go to "System Preferences" --> "Sound" --> "Input" and select "Internal microphone". Use the "Input volume" slider to adjust the microphone input level as described above.

But for a better and simpler user experience, I'd really like to control these settings from within code in my application.

I didn't seem to find this in Juce at this point, so I guess it'll need custom platform-specific calls.

Any hints / pointers anyone? Thanks!