import javax.sound.sampled.*; class M2ngija extends Thread{ AudioFormat formaat; byte[] andmed; public M2ngija(AudioFormat formaat, byte[] andmed){ this.formaat=formaat; this.andmed=andmed; start(); } public void run(){ try{ SourceDataLine line = (SourceDataLine) AudioSystem.getLine( new DataLine.Info(SourceDataLine.class, formaat, AudioSystem.NOT_SPECIFIED) ); line.open(formaat); line.start(); while(true){ line.write(andmed, 0, andmed.length); } } catch(Exception ex){ex.printStackTrace();} } }