Hardware Audio Mixer functions is an API function provided by Microsoft.
Open the Control item-sound in the control panel to set the input and output sounds of the system. For example, in audio ouput, you can view the Left and Right audio channels of the main volume, the volume, and whether the audio is muted and set. You can also set the CD volume and waveform respectively. The mixer API allows us to implement these functions by programming, and when these values are modified in the control panel (of course, other mixer APIs can also be called.Program). We can also receive related notifications.
The best document for learning mixer APIS is msdn. This is a Chinese mixerapi document I downloaded online. The download link is as follows:
Http://download.csdn.net/detail/q191201771/4506117
However, I think the content it says is not necessarily completely correct or is not necessarily the most suitable for understanding. Therefore, you have to do it yourself to really master the mixerapi.
The purpose of using the mixerapi is to disable all input sources except microphone in the program.
At first, I used to obtain the target line mixerline_componenttype_dst_wavein and then obtain its control mixercontrol_controltype_mixer. In this control, only microphone is enabled, and all others are disabled.
Tests in different environments show that some machines do not have the mixerline_componenttype_dst_wavein control in the target line mixerline_componenttype_dst_wavein. DescriptionIn different environments(This problem may be caused by the sound card type or the operating system version. Due to the number of testing machines and development time constraints, the problem cannot be fully clarified ),The lines and controls that can be obtained are different..
In different environments, the sound in the control panel can be set with different items, which seems to prove this.
Later, we acquired all the source lines of the target line mixerline_componenttype_dst_wavein and used the mute control in the source line to mute all the source lines except mic. This method is successful on several local test machines.
For more information, see www.cnblogs.com/chef.