title: unpack requires a string argument of length 2
body: <p>I unable to figure out whats the problem with my code</p>
  
  <pre><code>import wave,struct,math
  
  waveFile = wave.open("F:/mayaSound/ChillingMusic.wav", "rb") 
  volume = []
  
  frames = waveFile.getnframes()
  rate = waveFile.getframerate()
  length = frames / int(rate)
  
  
  for i in range (0,length):
      waveData = waveFile.readframes(1)
  
      data = struct.unpack("&lt;h",waveData)
      temp = (int(data[0])-128) / 128
      volume.append(20*math.log10(abs(temp) + 1))
  
  
  print volume
  
  waveFile.close() 
  </code></pre>
  
  <p>it gives me</p>
  
  <pre><code>Error: error: file &lt;maya console&gt; line 14: unpack requires a string argument of length 2 # 
  </code></pre>