title: Volume change event - listen when volume stopped changing
body: <p>My server is controlling windows volume using a third party library.
  When the server gets a message from the client telling it to change volume it's doing what it need to with no issues. However, I want to inform back to the client whenever the volume was changed locally on the computer. </p>
  
  <p>This library I'm using (https://workspaces.codeproject.com/ray-m/vista-core-audio-api-master-volume-control/article), has an event to notify volume changes. </p>
  
  <p>Problem is, it inform on every small volume change step and therefor the delegate is being called numerous times when a user changes volume. Example:</p>
  
  <p>If current volume is -23db and the user turns up the volume to a -13db then the delegate will be called 10 times!</p>
  
  <p>How can I listen for when the user started changing volume and then when it ended the action?</p>
  
  <p>This way I'll be able to send to the client the update through the delegate only once.</p>
  
  <p>Code tried:</p>
  
  <pre><code>void AudioEndpointVolume_OnVolumeNotification(AudioVolumeNotificationData data)
  {
  
      VolumeTimer.Interval = 300;
      VolumeTimer.Stop();
      VolumeTimer.Start();
  
  }
  
  private void VolumeTimer_Tick(object sender, EventArgs e)
  {
      VolumeTimer.Stop();
  
      lock (_lock)
      {
          ++_volumeCalledCounter;
  
          if (_volumeCalledCounter &lt;= 1)
          {
              Console.WriteLine("Fired");
              _volumeCalledCounter = 0;
          }
      }
  
  }
  </code></pre>