title: From IEEE32 float to 32bit integer numpy array (example : audio .wav files)
body: <p>I read some data which is stored as IEEE32 float in the interval <code>[-1, +1]</code> with </p>
  
  <pre><code>A = numpy.fromstring(data, dtype = numpy.float32)
  </code></pre>
  
  <p>But then I don't want to keep the array as <code>float32</code>, but rather, as 32-bit integers (in <code>[-2^31, +2^31-1]</code>).</p>
  
  <p>I tried by doing simply :</p>
  
  <pre><code>A = numpy.fromstring(data, dtype = numpy.int32)   # that's wrong!
  </code></pre>
  
  <p>but it provides a bad result. (wrong probably by a multiplicative constant, or another reason?)</p>
  
  <p><strong>How to read an array of IEEE32 float in [-1,1] into a 32bits-integer array in <code>[-2^31,  +2^31-1]</code> ?</strong></p>
  
  <hr>
  
  <p><em>PS : This would work, but I would like to avoid this naive way to do it :</em></p>
  
  <pre><code>A = numpy.fromstring(data, dtype = numpy.float32)
  A *= 2^31    
  A = int(A)   # convert the data type to int
  </code></pre>
  
  <p><em>if possible, because I imagine there is a more clever way to do it, without multipliying, but just by doing things bitwise...</em></p>