Cannot get devices
Hi,
I cannot get devices using CaptureDeviceManager.getDeviceList(null) in my code. This returns just empty vector. If I run JMFRegistry and click Capture Devices -> Detect Capture Devices, I get JavaSound audio capture. Does anybody know what am I doing wrong? I am on linux running sun-jdk-1.6.
[312 byte] By [
fordfroga] at [2007-11-26 21:10:19]

# 1
Just the code that doesn't work for me:
package cz.startnet.utils.javax.rtp;
import org.junit.Assert;
import org.junit.Test;
import java.util.Vector;
import javax.media.CaptureDeviceManager;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.TargetDataLine;
public class RTPMediaManagerTest {
@Test()
public void testDetectSupportedCodecs() {
final DataLine.Info info =
new DataLine.Info(
TargetDataLine.class,
null,
AudioSystem.NOT_SPECIFIED);
final boolean supported = AudioSystem.isLineSupported(info);
System.out.println("JavaSound supported = " + supported);
Assert.assertTrue(supported);
final Vector devices = CaptureDeviceManager.getDeviceList(null);
Assert.assertTrue(devices.size() > 0);
}
}
# 2
Well, it should work. Howeer try this.
final Vector devices = CaptureDeviceManager.getDeviceList(new AudioFormat();
And try this too
import javax.media.*;
import javax.media.protocol.*;
import java.net.*;
import java.io.*;
import javax.media.format.*;
import javax.swing.*;
public class JMFCapture3
{
public static void main(String args[]) throws Exception
{
System.out.println(CaptureDeviceManager.getDeviceList(null));
}
}