アットウィキロゴ

波

package sound;
 import javax.sound.sampled.*;
 import java.io.*;
 
public class pro {
 
    int[] z=new int[1000000];
 int number;
     int[] z2=new int[1000];
 
    public static void main(String[] args) {
        pro t=new pro();
    }
 
    pro(){
 
 
        catchwave("s.wav");
 int s;
 
 
 
        System.out.println(number);
 
        int n=number/100;
         for(s=0;s<n;s++){
        System.out.println(z[s*100]);  
        }
 
 
 
 
 
 
 
 
 
    }
 
 
    public void catchwave(String fileName){
 
 
 
        try{
 
         File file=new File(fileName);
 
 
         AudioInputStream st=AudioSystem.getAudioInputStream(file);
 
 
            byte[] buf=new byte[st.available()];
            st.read(buf,0,buf.length);
 
            int s;
 
        for(s=0;s<buf.length;s++){
        z[s]=buf[s];
        }
 
        number=buf.length;
 
 
      }catch(Exception e){e.printStackTrace();}
    }  
}
 
最終更新:2015年04月12日 00:24