문제

i'm trying to capture/play audio with java in linux with pulseaudio server.

there's no problem with playing. i can open capture device (microphone) but when calling micro.available returns 0 forever.

any tip ?

audioFormat = new AudioFormat(44100, 16, 2, true, false);
targetInfo = new DataLine.Info(TargetDataLine.class, audioFormat);
sourceInfo = new DataLine.Info(SourceDataLine.class, audioFormat);

targetDataLine = (TargetDataLine) AudioSystem.getTargetDataLine(audioFormat);
targetDataLine.open();
targetDataLine.start();    

sourceDataLine = (SourceDataLine) AudioSystem.getLine(sourceInfo);
sourceDataLine.open(audioFormat);
도움이 되었습니까?

해결책

The problem is in the sun jdk. With openjdk it works.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top