Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set audio input level using portaudio

I am dealing with a legacy code that uses portaudio on windows. The code grabs audio from desktop mic and has ability to configure input volume. It worked perfectly under windows xp, but tuning audio input level is broken under windows 7, changing the parameter has no effect on output audio stream. Code do the following to adjust volume

mp_mixer = Px_OpenMixer(mp_inputStream, m_dev_num);
if(mp_mixer) Px_SetInputVolume(mp_mixer, m_volume);

I have discovered, that underling winmme functions does not work in Windows Vista and newer. I have updated to last version of portaudio pa_stable_v19_20140130 in which Mixer functions are not available anymore. I can't find alternative way to adjust input volume in portsound, Is there any?

like image 844
capone Avatar asked Dec 12 '25 06:12

capone


1 Answers

I think you are going to have to use the Audio Endpoint Device API. http://msdn.microsoft.com/en-us/library/windows/desktop/dd370793(v=vs.85).aspx

Like you said the WMME mixer API is no longer supported.

The API isn't too bad. Just make sure you use the portaudio API device index to identify the device in the mixer API.

like image 133
trukvl Avatar answered Dec 15 '25 06:12

trukvl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!