title: Detect current volume level while a file is playing using Naudio
body: <p>So I have</p>
  
  <pre><code>    IWavePlayer waveOutDevice;
      WaveStream mainOutputStream;
      WaveChannel32 volumeStream;
  
      private WaveStream CreateInputStream(string fileName)
      {
          WaveChannel32 inputStream;
          if (fileName.EndsWith(".mp3"))
          {
              WaveStream mp3Reader = new Mp3FileReader(fileName);
              inputStream = new WaveChannel32(mp3Reader);
          }
          else
          {
              throw new InvalidOperationException("Unsupported extension");
          }
          volumeStream = inputStream;
          return volumeStream;
      }
  
      private void Stop()
      {
          if (waveOutDevice != null)
          {
              waveOutDevice.Stop();
          }
          if (mainOutputStream != null)
          {
              // this one really closes the file and ACM conversion
              volumeStream.Close();
              volumeStream = null;
              // this one does the metering stream
              mainOutputStream.Close();
              mainOutputStream = null;
          }
          if (waveOutDevice != null)
          {
              waveOutDevice.Dispose();
              waveOutDevice = null;
          }
      }
  
      private void Play(string was)
      {
          waveOutDevice = new WaveOut();
          mainOutputStream = CreateInputStream(was);
          waveOutDevice.Init(mainOutputStream);
          waveOutDevice.Play();
  
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
          Play(@"E:\Eigene Audiodateien\Musik\Alben\Pur\Abenteuerland\ -  - .mp3");
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          Stop();
      }
  </code></pre>
  
  <p>There is a Stop-Button ( button1 ), which stops playback. When the form is loaded, the file is played. While the file is playing I want to get the current volume of the file by running a function. So what does a function like this has to look like at "...."?</p>
  
  <pre><code>private int currentVolumeLevel(...some suitable parameters...)
  {
    int currentVolumeLevelValue = 0;
    //....
    return currentVolumeLevelValue;
  }
  </code></pre>
  
  <p>I am not talking about the volume level you can adjust with windows' sound controls. I am talking about the currently played sound file's volume at this very position it is playing right now, based on something like a byte[] array.</p>