title: How is SndVol able to change the volume level of a given audio session?
body: <p>I am writing my own API to perform some of the functionality of the SndVol system utility. I would like part of this API to be the ability to set the volume level of a given <a href="http://msdn.microsoft.com/en-us/library/ms678707.aspx" rel="noreferrer">audio session</a>.</p>
  
  <p>SndVol displays a slider on the "Device" panel that the user can use to change the master volume level of the audio device as well as a slider for each audio session (on the "Applications" panel) that changes the volume level of the session:</p>
  
  <p><img src="https://i.stack.imgur.com/2C3TA.png" alt="Screenshot of SndVol Volume Mixer"></p>
  
  <p>If I drag the slider handle for one of the audio sessions, then SndVol is able to change the audio session's volume level. How does it do that?</p>
  
  <p>I thought that it was possible using Windows Vista's <a href="http://msdn.microsoft.com/en-us/library/dd370805%28v=VS.85%29.aspx" rel="noreferrer">Core Audio API</a>, but I encountered the problem that although I am able to iterate audio sessions of a device using an <a href="http://msdn.microsoft.com/en-us/library/dd368281%28v=VS.85%29.aspx" rel="noreferrer"><code>IAudioSessionEnumerator</code></a>, the <code>IAudioSessionEnumerator</code> only gives me access to <a href="http://msdn.microsoft.com/en-us/library/dd368246%28v=VS.85%29.aspx" rel="noreferrer"><code>IAudioSessionControl</code></a> objects, but I need the <a href="http://msdn.microsoft.com/en-us/library/dd370865%28v=VS.85%29.aspx" rel="noreferrer"><code>IAudioClient</code></a> object to obtain an <a href="http://msdn.microsoft.com/en-us/library/dd316531%28v=VS.85%29.aspx" rel="noreferrer"><code>ISimpleAudioVolume</code></a> object that I can use to set the audio session volume level. Is it possible to get the <code>IAudioClient</code> object associated with an <code>IAudioSessionControl</code> object?</p>