0
import javax.media.*;
import java.util.*;
public class ListCaptureDevices {
public static void main(String[] args) {
Vector info = CaptureDeviceManager.getDeviceList(null);
if (info == null)
System.out.println("No Capture devices known to JMF");
else {
System.out.println("The following " + info.size()
+ " capture devices are known to the JMF");
for (int i = 0; i < info.size(); i++)
System.out
.println("\t" + (CaptureDeviceInfo) info.elementAt(i));
}
}
}
以上是列出捕獲設備的代碼。它不返回null
矢量,但它仍然將矢量的大小打印爲0
並且表示找不到任何設備。這段代碼有什麼問題?Java:使用Java Media Framework的音頻捕獲設備列表
歡迎來到SO。請格式化代碼示例。要做到這一點,請選擇樣本並點擊郵件發佈/編輯表格上方的「{}」按鈕。 – 2012-02-10 04:13:23