title: Get decibels of 1 second of audio file using naudio
body: <p>I wanna to calculate decibels of 1 second of any .wav file using naudio. This is my code:</p>
  
  <pre><code>WaveFileReader reader = new WaveFileReader(@"C:\Users\Admin\Desktop\result.wav");
  int bytesPerMillisecond = reader.WaveFormat.AverageBytesPerSecond / 1000;            
  //byte[] buffer = new byte[reader.Length];
  //int read = reader.Read(buffer, 0, (int)reader.Length);
  TimeSpan time = new TimeSpan(0, 0, 1);
  
  int bytesPerSecond = (int)time.TotalMilliseconds * bytesPerMillisecond;
  byte[] oneSecondBuffer = new byte[bytesPerSecond];
  int read = reader.Read(oneSecondBuffer, 0, bytesPerSecond);
  
  short sample16Bit = BitConverter.ToInt16(oneSecondBuffer, 1);
  double volume = Math.Abs(sample16Bit / 32768.0);
  double decibels = 20 * Math.Log10(volume);
  </code></pre>
  
  <p>This line:</p>
  
  <pre><code>short sample16Bit = BitConverter.ToInt16(oneSecondBuffer, 1);
  </code></pre>
  
  <p>returns 0. What am I doing wrong?</p>