3
votes

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?

1
Why can't you just adjust it manually? Loop through the data and multiply each value in your buffer. That's all the mixer really does anyway, just multiply the values by a certain degree.benjgorman
@benjgorman are you sure? There's the separate concept of input gain. This controls the analog preamplifier before sampling. It can have a big effect on your signal-to-noise ratio.Michael Fox

1 Answers

1
votes

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.