[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[ZT]Windows32位系统右下角托盘中的音量控制程序的命令行参数

sndvol32命令行参数
[ 2007-9-19 17:32:00 | ]


sndvol32是微软的一个音量控制组件,路径是C:\WINDOWS\system32\sndvol32.exe。
格式 :
sndvol32 [-Daudio_device_number] [-Record | -Play] [-Normal | -Small | -Tray]

说明:
注意到上面格式里有的参数大写了吗,凡是大写的参数可以简写为首字母。
-Record    录音模式
-Play        播放模式
-Normal    正常大小
-Small      简洁
-Tray        托盘大小(与用鼠标左键单击托盘里的音量控制图标弹出的窗口一样)
-D             只在安装了多个音频设备(如USB Phone)时才需要使用。

举例 :
sndvol32 -record 或sndvol32 -rec 或sndvol32 -r
sndvol32 -t
sndvol32 -D2 -R -S


技巧:

在打开的音量控制窗口中,可以使用“向上”或“向右”键增大滑块值、“向下”或“向左”键减小滑块值,但是改变的幅度比较小。要更快速地调节,可以使用“上页”键增大滑块值、“下页”键减小滑块值。

在打开的音量控制窗口中,按“ Ctrl + S ”键可以在简洁模式和一般模式间切换。



附:英文原文(http://home.austarnet.com.au/davekimble/volume-controls.htm

sndvol32 command line parameters

sndvol32 is a Microsoft applet that displays the volume controls.
It is normally located at C:\WINDOWS\system32\sndvol32.exe

Format :
sndvol32 [-Daudio_device_number] [-Record | -Play] [-Normal | -Small | -Tray]

The "-D" parameter is only needed if you have more than one audio device installed, such as a USB Phone in addition to your computer's built-in sound device.

Example :
sndvol32 -D2 -R -S
1

评分人数

    • wxcute: 辛苦收集。非常棒。PB + 5

厉害,第一次见这个资料。

TOP

可以用命令行调节音量吗?

TOP

回复 3楼 的帖子

可以用vbs的Sendkeys吧?或者写个控制台程序

TOP

sendkeys容易落空啊,
至于控制台程序。。。。。。
我对硬件驱动不是很熟。。。。。。

TOP

回复 5楼 的帖子

我对硬件驱动不是很熟

我完全不会:(

TOP

回复 6楼 的帖子

windows有没有提供相关的API呢?

TOP

用au3写了一个命令行控制音量的,在我的网盘里。
http://pusofalse.ys168.com 密码是bathome
SoundSetVolume.rar  命令行修改系统音量
  1. @echo off
  2. ::sound <音量百分比>
  3. sound 50
  4. sound 100
复制代码
心绪平和,眼藏静谧。

TOP

NirCmd 里面的 setvolume
setvolume [device] [left-volume] [right-volume]
Set the volume level of your sound device. The [device] parameter represents the device identifier. In most cases, you should use '0' value for this parameter. Under Windows Vista, you should specify 0 for default playback device or 1 for default recording device.
The [left-volume] and [right-volume] parameters should contain a value between 0 (silence) and 65535 (full volume) that represents the volume level for left and right channels.
Examples:
setvolume 0 0 0
setvolume 0 32768 32768
setvolume 0 0xffff 0
setsysvolume [volume] {Component} {Device Index}
Set the sound volume for your system. Changing this value also affects the sound volume settings under 'Control Panel'. The [volume] parameter should contain a value between 0 (silence) and 65535 (full volume).
{Component} is an optional parameter that specifies one of the following sound components: master, waveout, synth, cd, microphone, phone, aux, line, headphones, wavein. The default value is 'master' (for master volume). Under Windows Vista, the component name must be identical to the one of the device names appear in the sound window of Vista (Control Panel -> Sound). If the device name contains spaces, it must be in quotes.
{Device Index} is an optional parameter that specifies the sound device index. This parameter is useful if you have more than one sound card. If you don't specify this parameter, the default sound card in Control Panel is used.
Examples:
setsysvolume 0x8000
setsysvolume 0
setsysvolume 25000 waveout
setsysvolume 25000 master 1
Vista Examples:
setsysvolume 0x8000
setsysvolume 0 "front mic"
setsysvolume 25000 speakers
setsysvolume 25000 "line in"
setsysvolume2 [left volume] [right volume] {Component} {Device Index}
Similar to setsysvolume, but instead of setting the whole sound volume, setsysvolume2 set the right channel and left channel separately.
Examples:
setsysvolume2 10000 20000
setsysvolume2 30000 0
setsysvolume2 25000 15000 waveout
setsysvolume2 30000 0 master 1

http://bbs.bathome.net/thread-1881-1-1.html

[ 本帖最后由 Batcher 于 2008-11-26 18:19 编辑 ]
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

9楼的功能很丰富啊!
pusofalse能给出源码吗?

TOP

Set WshShell = Wscript.CreateObject("Wscript.Shell")
WshShell.Sendkeys ""  '静音
WshShell.Sendkeys ""  '减音
WshShell.Sendkeys ""  '增音
2

评分人数

    • tireless: &quot;爱&quot; 会执行“下一首”和“静音” ...PB + 1
    • rat: 多媒体键盘PB + 20 技术 + 1

TOP

回复 11楼 的帖子

写错了。应该是:

"爱" 会执行“下一首”和“减音”

TOP

返回列表