package server1; import java.io.IOException; import java.io.InputStream; import javax.sound.sampled.SourceDataLine; public class KuulajaL6im implements Runnable { InputStream is; SourceDataLine line; public KuulajaL6im(InputStream uis, SourceDataLine uline){ is=uis; line=uline; new Thread(this).start(); } public void run(){ byte[] andmed=new byte[24000]; while(true){ try { is.read(andmed); } catch (IOException e) { e.printStackTrace(); } line.write(andmed, 0, andmed.length); } } }