0
AudioSystem.Mixer 인터페이스를 사용하여 wav 파일을 간단히 재생하려고합니다. 먼저 어떤 믹서 (장치)를 내 출력으로 사용해야하는지 확인하려고했습니다. 결과적으로 포트 유형이 지원되지 않습니다. 뭐가 문제 야?Java Sound on OSX no Port.Info Type
import java.io.*;
import javax.sound.sampled.*;
public class STest12{
public static void main(String[] args) {
try {
Mixer.Info[] mi = AudioSystem.getMixerInfo();
Port.Info[] allePorts = {
Port.Info.COMPACT_DISC,
Port.Info.HEADPHONE,
Port.Info.LINE_IN,
Port.Info.LINE_OUT,
Port.Info.MICROPHONE,
Port.Info.SPEAKER
};
for (Mixer.Info mixerInfo : mi) {
Mixer mixer = AudioSystem.getMixer(mixerInfo);
System.out.println("---------------------------------");
System.out.println(mixer.getMixerInfo().toString());
for (Port.Info i : allePorts) {
System.out.println(i.toString() + " supported: " + mixer.isLineSupported(i));
}
}
} catch (Exception e) {
e.printStackTrace();
}
}//main
}//class
코드를 올바르게 포맷하십시오. – Krumia