import java.io.*; import javax.sound.sampled.*; public class CDHeli1{ static AudioFormat formaat; static byte[] loe(String failinimi) throws Exception{ AudioInputStream sisse=AudioSystem.getAudioInputStream(new File(failinimi)); formaat=sisse.getFormat(); ByteArrayOutputStream malu=new ByteArrayOutputStream(); int nr=sisse.read(); while(nr!=-1){ //loetakse voo sisu mälupuhvrisse malu.write(nr); nr=sisse.read(); } return malu.toByteArray(); } static void mangi(byte[] andmed) throws Exception{ SourceDataLine line=(SourceDataLine)AudioSystem.getLine( new DataLine.Info(SourceDataLine.class, formaat, AudioSystem.NOT_SPECIFIED) ); line.open(); line.start(); line.write(andmed, 0, andmed.length); line.drain(); } static void kirjuta(byte[] andmed, String failinimi) throws Exception{ AudioInputStream ais=new AudioInputStream( new ByteArrayInputStream(andmed), formaat, andmed.length ); AudioSystem.write(ais, AudioFileFormat.Type.WAVE, new File(failinimi)); } static void trykiEkraanile(byte[] andmed){ int pikkus=andmed.length/4; for(int i=0; i>8) & 0xFF); byte b2=(byte)(sisu & 0xFF); andmed[algkoht]=b1; andmed[algkoht+1]=b2; } static void muudaValjust(byte[] andmed, double koef){ int pikkus=andmed.length/4; for(int i=0; i