package server1; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled.TargetDataLine; import java.net.*; import java.io.*; public class Saatja { /** * @param args */ public static void main(String[] args) throws Exception{ AudioFormat formaat=new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 8000, 8, 1, 1, 8000, true); DataLine.Info info=new DataLine.Info(TargetDataLine.class, formaat); TargetDataLine sisend=(TargetDataLine)AudioSystem.getLine(info); sisend.open(formaat, sisend.getBufferSize()); sisend.start(); byte andmed[]=new byte[24000]; int baitidearv=sisend.read(andmed, 0, andmed.length); Socket sc=new Socket("localhost", 3001); OutputStream os=sc.getOutputStream(); while(true){ os.write(andmed); sisend.read(andmed, 0, andmed.length); } } }