The new version of NirCmd provides 3 new commands to control the sound volume on Windows 7/Vista/2008:
- setdefaultsounddevice - Allows you the set the default sound device on Windows 7/Vista/2008, exactly like you can do it from this window:
Example for using this command:
NirCmd.exe setdefaultsounddevice "Line In"
- setsubunitvolumedb - Allows you the set the sound volume level of subunits of a sound device, as you can do in the following device properties window:
As opposed to the above user interface of Windows, which allows you to set the volume level in percent scale, the command of NirCmd only allows you to set the volume level in decibel unit. So far, I couldn't locate the exact formula that Microsoft uses to convert the decibel values into %.
Examples for using the setsubunitvolumedb command:
setsubunitvolumedb "Speakers" "Line In" -12
setsubunitvolumedb "Speakers" "Microphone" -20
- mutesubunitvolume - Allows you to mute/unmute the subunits of a sound device.
Examples for using the mutesubunitvolume command:
mutesubunitvolume "Speakers" "Line In" 0
mutesubunitvolume "Speakers" "Microphone" 1