public void run() { try { b = new byte[6300]; line.open(new AudioFormat(44100, 16, 1, true, true), 6300); line.start(); while (true) { line.read(b, 0, b.length); server.writeByteBuffers(b, sourceIndex); if (output) serverOutput.write(b, 0, b.length); } } catch (LineUnavailableException e) { e.printStackTrace(); System.out.println(sourceIndex); } finally { line.stop(); line.close(); } }