M
Mosiuoa Tsietsi
I'm trying to capture sound in Java by using the Port.Info class. My
sound card does support recording from the line in because I've tested
it using the Sound Recorder program in Windows. But when I try to use
the following code :
if (AudioSystem.isLineSupported(Port.Info.LINE_IN)) {
try {
Port line = (Port)
AudioSystem.getLine(Port.Info.LINE_IN);
}catch(LineUnavailableException e){
}
}
it never executes the content of the if statement. If I use the
condition:
if (!AudioSystem.isLineSupported(Port.Info.LINE_IN)) {....}
instead, I get the following error:
java.lang.IllegalArgumentException: No line matching LINE_IN source
port is supported at
javax.sound.sampled.AudioSystem.getLine(AudioSystem.java:309)
Can anyway help? Thanks in advance.
sound card does support recording from the line in because I've tested
it using the Sound Recorder program in Windows. But when I try to use
the following code :
if (AudioSystem.isLineSupported(Port.Info.LINE_IN)) {
try {
Port line = (Port)
AudioSystem.getLine(Port.Info.LINE_IN);
}catch(LineUnavailableException e){
}
}
it never executes the content of the if statement. If I use the
condition:
if (!AudioSystem.isLineSupported(Port.Info.LINE_IN)) {....}
instead, I get the following error:
java.lang.IllegalArgumentException: No line matching LINE_IN source
port is supported at
javax.sound.sampled.AudioSystem.getLine(AudioSystem.java:309)
Can anyway help? Thanks in advance.