Checking for a supported output line.

Java to go!
Java Sound QuickStart

Tony Loton
Listing 2. Checking for a supported output line.


DataLine.Info outInfo = new
 DataLine.Info(SourceDataLine.class, format);

if (!AudioSystem.isLineSupported(outInfo))
{
  System.out.println(“Line matching “ +
   outInfo + “ not supported.”);
}