title: C# NAudio Get audio file duration / Performance
body: <p>I'm using NAudio to create a music player that supports playlists. I'm retreiving the duration of each track as follows :</p>
  
  <pre><code>return new AudioFileReader(FilePath).TotalTime;
  </code></pre>
  
  <p>But this is a true performance killer when working with many tracks. It takes say 1 second for 15 / 20 audio files. Is there a way to optimize that ? I don't think I can reuse the AudioFile reader object since it doesn't provide any method for that, and I don't know what else I can use to get the audio file duration.</p>