title: convert a wav file to a txt file
body: <p>thanks for reading this
  Well what I'm trying to do is to take a .wav file (only a short audio) and convert it to ints, and every one represent a tone of the audio...
  If you're asking why I'm doing this, is because I'm doing an arduino project, and I want to make the arduino to play a song, and for doing that I need an int array where every int is a tone.
  So I thought, "well if I program a little application to convert any .wav file to a txt where are stored the ints that represent the melody notes, I just need to copy this values to the arduino project code";
  So after all this, maybe you're asking "What is your problem?";
  I done the code and is "working", the only problem is that the txt only have "1024" in each line...
  So it's obviously that I'm having a problem, no all the tones are 1024 -_-</p>
  
  <pre><code>package WaveToText;
  
  import java.io.*;
  
  /**
  *
  * @author  Luis Miguel Mejía Suárez
  * @project This porject is to convert a wav music files to a int array
  *          Which is going to be printed in a txt file to be used for an arduino
  * @serial  1.0.1 (05/11/201)
  */
  
  public final class Converter 
  {
  /**
   * 
   * @Class Here is where is going to be allowed all the code for the application
   * 
   * @Param Text is an .txt file where is going to be stored the ints
   * @Param MyFile is the input of the wav file to be converted
   */
  
  PrintStream Text;
  InputStream MyFile;
  
  public Converter () throws FileNotFoundException, IOException
  {
          MyFile = new FileInputStream("C:\\Users\\luismiguel\\Dropbox\\ESTUDIO\\PROGRAMAS\\JAVA\\WavToText\\src\\WaveToText\\prueba.wav");
          Text = new PrintStream(new File("Notes.txt"));
  }
  
  public void ConvertToTxt() throws IOException
  {
      BufferedInputStream in = new BufferedInputStream(MyFile);
  
      int read;
  
      byte[] buff = new byte[1024];
      while ((read = in.read(buff)) &gt; 0)
      {
          Text.println(read);
      }
      Text.close();
  }
  
  /**
   * @param args the command line arguments
   */
  public static void main(String[] args) throws IOException{
      // TODO code application logic here
      Converter Exc = new Converter();
      Exc.ConvertToTxt();        
  }
  </code></pre>
  
  <p>}</p>