FileDocCategorySizeDatePackage
JavaSoundDetector.javaAPI DocJMF 2.1.1e560Mon May 12 12:20:34 BST 2003None

JavaSoundDetector.java

/*
 * @(#)JavaSoundDetector.java	1.3 02/08/21
 *
 * Copyright (c) 1996-2002 Sun Microsystems, Inc.  All rights reserved.
 */

import javax.sound.sampled.*;


public class JavaSoundDetector {

    boolean supported = false;

    public JavaSoundDetector() {
	try {
	    DataLine.Info info = new DataLine.Info(TargetDataLine.class,
						   null,
						   AudioSystem.NOT_SPECIFIED);
	    supported = AudioSystem.isLineSupported(info);

	} catch (Exception ex) {
	    supported = false;
	}
    }

    public boolean isSupported() {
	return supported;
    }

}