ThbWaveOut.DeviceID
Unit: hbTapiWave
 

Set this property to indicate which waveform-audio output device should be used. All available devices are listed in the ThbWaveOut.DeviceList property. Legal values for this property are 0 to ThbWaveOut.DeviceList.Count -1. The ThbWaveOut.DeviceName property is set to the corresponding name.

for i := 0 to hbWaveOut1.DeviceList.Count-1 do
begin
  hbWaveOut1.DeviceID := i;
  if hbWaveOut1.Available then
  begin
    ListBox1.Items.Add(hbWaveOut1.DeviceName + ' is available');
  end;
end;

Availability

Design-Time: None / Run-Time: Read, Write

Declaration

property DeviceID: DWord;

Remarks

If the device is active prior to setting the DeviceID, then you must deactivate the component (WaveOut.Active := False) otherwise an exception will be raised. Your application should not save the DeviceID to restore an users configuration because it could change in due to installing/removing sound devices. The better choice is to store the DeviceName.

See Also

ThbWaveOut.DeviceName | DeviceList | Available