title: Reading data from a .wav file using only native python
body: <p>I am attempting to write a program that detects the frequency of a sound in a .wav file.  I would like to do this with exclusively native python, no third-party modules.  I used the built-in read() and open() functions and got some strange results:</p>
  
  <pre><code>with open('pcm-test.wav', 'rb') as f:
      data = f.read(255)
  print data
  </code></pre>
  
  <p>When I run it, I get this:</p>
  
  <pre><code>&gt;&gt;&gt; 
  RIFF$ÈWAVEfmt data
  &gt;&gt;&gt;
  </code></pre>
  
  <p>What am I doing wrong?  Any advice would be appreciated. Thanks!</p>
  
  <p><em>EDIT</em></p>
  
  <p>I suppose I phrased this wrong.  I'm looking for the frequency of the tone in the .wav file, not the sample rate.  I have an algorithm for computing frequency based on an array of amplitudes, but I have no way of finding it.  I guess my question would be how can I get raw amplitude data from the .wav file and store it as a list, tuple, etc.</p>