Frage

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);
War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top