检索声音设备的音量设置.
Setting := SoundGetVolume(Component, Device)
组件的显示名称和/或索引. 例如, 1, "Line in" 或 "Line in:2".
如果省略或为空, 则检索主音量设置.
有关详情, 请参阅 Component (Sound 函数).
设备的显示名称和/或索引. 例如, 1, "Speakers", "Speakers:2" 或 "Speakers (Example HD Audio)".
如果省略该参数, 则它默认为系统的默认回放设备(不一定是设备 1).
有关详情, 请参阅 Device (Sound 函数).
函数返回 0.0 到 100.0 之间的浮点数.
失败时可能会抛出以下异常之一:
| Error 类 | 消息 |
|---|---|
| TargetError | Device not found(无法找到设备) |
| Component not found(无法找到组件) | |
| Component doesn't support this control type(组件不支持此控件类型) | |
| OSError | System-generated.(由系统生成) |
要发现系统上安装的声音设备的功能 -- 比如名称和可用的组件 -- 请运行这个声卡分析脚本.
mic_volume := SoundGetVolume("Microphone")
MsgBox "Microphone listening volume is " mic_volume " percent."