SoundGetName

サウンドデバイスやコンポーネントの名前を取得します。

Name := SoundGetName(Component, Device)

パラメータ

コンポーネント

型:文字列または整数

If blank or omitted, the name of the device itself will be retrieved. Otherwise, specify the component's display name and/or index, e.g. 1, "Line in" or "Line in:2".

詳しくは「コンポーネント(サウンド機能)」をご覧ください。

Device

型:文字列または整数

If blank or omitted, it defaults to the system's default device for playback (which is not necessarily device 1). Otherwise, specify the device's display name and/or index, e.g. 1, "Speakers", "Speakers:2" or "Speakers (Example HD Audio)".

詳しくはデバイス(サウンド機能)をご覧ください。

戻り値

型:文字列

This function returns the name of the device or component, which can be empty.

エラー処理

A TargetError is thrown if the device or component could not be found. Otherwise, an OSError is thrown on failure.

サウンド機能

デフォルトの再生デバイス名を取得し、報告する。

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

より複雑な例については、サウンドカード解析スクリプトを参照のこと。