Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>To answer your first question, you can check if the <a href="http://java.sun.com/javase/6/docs/api/javax/sound/sampled/Line.Info.html" rel="nofollow noreferrer">Line.Info</a> object for your recording input matches <a href="http://java.sun.com/javase/6/docs/api/javax/sound/sampled/Port.Info.html#LINE_IN" rel="nofollow noreferrer">Port.Info.LINE_IN</a> like this:</p> <pre><code>public static boolean isLineIn(Line.Info lineInfo) { Line.Info[] detected = AudioSystem.getSourceLineInfo(Port.Info.LINE_IN); for (Line.Info lineIn : detected) { if (lineIn.matches(lineInfo)) { return true; } } return false; } </code></pre> <p>However, this doesn't work with operating systems or soundcard driver APIs that don't provide the type of each available mixer channel. So when I test it on Windows it works, but not on Linux or Mac. For more information and recommendations, see this <a href="http://www.jsresources.org/faq_audio.html#no_predefined_ports" rel="nofollow noreferrer">FAQ</a>.</p> <p>Regarding your second question, you can try changing the recording input settings through a <a href="http://java.sun.com/javase/6/docs/api/javax/sound/sampled/Control.html" rel="nofollow noreferrer">Control</a> class. In particular, see <a href="http://java.sun.com/javase/6/docs/api/javax/sound/sampled/FloatControl.Type.html" rel="nofollow noreferrer">FloatControl.Type</a> for some common settings. Keep in mind that the availability of these controls depends on the operating system and soundcard drivers, just like line-in detection.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload