Sound card detection - simple solution
Hello,
this goes to all who are interested. The question how to detect a sound card was brought up in the past, and I found a quite simple way to do it. To my knowledge, this was not posted before.
The following code returns true if a sound card is present and enabled. I tested it on a couple of machines, and it seems to work just fine. It even works in Applets.
import javax.sound.sampled.*;
private boolean detectSoundcard() {
Line.Info il = new Line.Info(TargetDataLine.class);
return AudioSystem.isLineSupported(il);
} // detectSoundCard
Comments are very welcome,
Stefan

