检索声音设备或组件的名称.
Name := SoundGetName(Component, Device)
组件的显示名称和/或索引. 例如, 1, "Line in" 或 "Line in:2".
如果省略或为空, 将检索设备本身的名称.
有关详情, 请参阅 Component (Sound 函数).
设备的显示名称和/或索引. 例如, 1, "Speakers", "Speakers:2" 或 "Speakers (Example HD Audio)".
如果省略该参数, 则它默认为系统的默认回放设备(不一定是设备 1).
有关详情, 请参阅 Device (Sound 函数).
类型: 字符串
设备或组件的名称, 可以为空.
失败时可能会抛出以下异常之一:
| Error 类 | 消息 |
|---|---|
| TargetError | Device not found(无法找到设备) |
| Component not found(无法找到组件) | |
| OSError | System-generated.(由系统生成) |
default_device := SoundGetName() MsgBox 'The default playback device is "' default_device '".'
有关更复杂的示例, 请参阅声卡分析脚本.
dftg