title: reading .wav file: converting little endian and big endian to integer
body: <p>I'm writing a little program to read a .wav file. According to the wav specs I've been looking at:</p>
  
  <p><img src="https://www.codeproject.com/KB/audio-video/Concatenation_Wave_Files/conca1.JPG" alt="graphic of .wav file format"></p>
  
  <p>it looks like the second four bytes are a 4 byte little endian number. I think this means that the least significant byte is the first one, byte number 5, so in otherwords, I read them from left to right. From what I've been reading, I think I should multiply them like this:</p>
  
  <pre><code>n=bytearray[5]+(bytearray[6]*256)+(bytearray[7]*256)+(bytearray[8]*16777216)
  </code></pre>
  
  <p>so byte in </p>
  
  <p>but that comes out to a pretty damn large number, 1,459,618,138 in decimal for a file that is only 90k long. So I think I'm making a mistake here somewhere.</p>
  
  <p>for the other numbers, if I understand the difference between little endian and big endian is right to left vs left to right order of the bytes?</p>