import java.io.*; import javax.sound.sampled.*; public class Failimang2{ public static void main(String[] argumendid) throws Exception{ AudioInputStream sisse=AudioSystem.getAudioInputStream(new File(argumendid[0])); AudioFormat f=sisse.getFormat(); System.out.println(f); SourceDataLine line=(SourceDataLine)AudioSystem.getLine( new DataLine.Info(SourceDataLine.class, f, AudioSystem.NOT_SPECIFIED) ); line.open(); line.start(); int puhvrisuurus=8000; byte[] baidid=new byte[puhvrisuurus]; int loetud=0; while((loetud=sisse.read(baidid, 0, puhvrisuurus))!=-1){ line.write(baidid, 0, loetud); } line.drain(); System.exit(0); } }