检索声音设备或组件的名称.
Name := SoundGetName(Component, Device)
类型: 字符串或整数
组件的显示名称和/或索引. 例如, 1, "Line in" 或 "Line in:2".
1
"Line in"
"Line in:2"
如果省略或为空, 将检索设备本身的名称.
有关详情, 请参阅 Component (Sound 函数).
设备的显示名称和/或索引. 例如, 1, "Speakers", "Speakers:2" 或 "Speakers (Example HD Audio)".
"Speakers"
"Speakers:2"
"Speakers (Example HD Audio)"
如果省略该参数, 则它默认为系统的默认回放设备(不一定是设备 1).
有关详情, 请参阅 Device (Sound 函数).
类型: 字符串
设备或组件的名称, 可以为空.
失败时可能会抛出以下异常之一:
Sound 函数
检索并报告默认播放设备的名称.
default_device := SoundGetName() MsgBox 'The default playback device is "' default_device '".'
检索并报告第一个设备的名称.
device1 := SoundGetName( , 1) MsgBox 'Device 1 is "' device1 '".'
索并报告第一个组件的名称.
component1 := SoundGetName(1) MsgBox 'Component 1 is "' component1 '".'
有关更复杂的示例, 请参阅声卡分析脚本.