title: Python - Convert Array of Float audio data to wav file
body: <p>I have audio data recorded from microphone like this : (ndarray of float)</p>
  
  <pre><code>&gt; print(data)
  [-0.00762939 -0.00817871 -0.00714111 ...  0.0265511   0.02484207   0.02377392]
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>while(recording):
     frames.append(data)
  
  waveFile = wave.open(WAVE_OUTPUT_FILENAME + "_" + str(COUNT_FILE) + ".wav", 'wb')
  waveFile.setnchannels(CHANNELS)
  waveFile.setsampwidth(audio.get_sample_size(FORMAT))
  waveFile.setframerate(RATE)
  waveFile.wr(b''.join(frames))
  waveFile.close()
  </code></pre>
  
  <p>But when I play the audio it become broken, nothing but just noise... how to convert it into .wav audio file?</p>