title: How to manipulate wav file data in Python?
body: <p>I'm trying to read a wav file, then manipulate its contents, sample by sample</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>import scipy.io.wavfile
  import math
  
  rate, data = scipy.io.wavfile.read('xenencounter_23.wav')
  
  for i in range(len(data)):
      data[i][0] = math.sin(data[i][0])
      print data[i][0]
  </code></pre>
  
  <p>The result I get is:</p>
  
  <pre><code>0
  0
  0
  0
  0
  0
  </code></pre>
  
  <p>etc</p>
  
  <p>It is reading properly, because if I write <code>print data[i]</code> instead I get usually non-zero arrays of size 2.</p>