title: How can I determine the length (i.e. duration) of a .wav file in C#?
body: <p>In the uncompressed situation I know I need to read the wav header, pull out the number of channels, bits, and sample rate and work it out from there:
  (channels) * (bits) * (samples/s) * (seconds) = (filesize)</p>
  
  <p>Is there a simpler way - a free library, or something in the .net framework perhaps?</p>
  
  <p>How would I do this if the .wav file is compressed (with the mpeg codec for example)?</p>