title: Get frequency value (hz) in split wav audio file by python
body: <p>I have simple case, i'm recording bee sound in Bee have by <code>python pyAudio</code>. After recording i have to split this record in 10 sec chunks and analyze this chunks by <code>python wave, numpy</code> or <code>python scipy, numpy</code>, i don't know what is easiest way. 
  I would like to read the record then split it to 10 sec chunk and apply <strong>fft</strong> or <strong>rfft</strong> and after that i need get dominant frequencies in Hz in chunk.
  I collect this values with timestamp in histogram for histogram plot.</p>
  
  <p>Right now i have some examples where i can get whole record and make plot by <code>python matplotlib, scipy.signal</code> but i don't know how to separated it into listo of Hz values.</p>
  
  <p>If i have completely wrong way please tell me. Thx for advice.</p>
  
  <pre><code>import numpy as np
  import struct, wave
  
  def main():
     audio = wave.open('wav_data/18-08-07_09_10_12.wav', 'rb')
     rate = audio.getframerate()
     num_frames = audio.getnframes()
     dur = int(num_frames / rate)
     fmt = "%ih" % rate
  
     for x in range(dur):
       data = audio.readframes(rate)
       data_int = struct.unpack(fmt, data)
       data_np = np.array(data_int, dtype='b')
       w = np.fft.rfft(data_np)
       freqs = np.fft.fftfreq(len(w))
       idx = np.argmax(w)
       freq = freqs[idx]
       freq_in_hz = abs(freq * rate)
       print(freq_in_hz)
  
  if __name__ == "__main__":
     main()
  </code></pre>