public static float GetWaveOutVolume(IntPtr hWaveOut, object lockObject) { int stereoVolume; MmResult result; lock (lockObject) { result = WaveInterop.waveOutGetVolume(hWaveOut, out stereoVolume); } MmException.Try(result, "waveOutGetVolume"); return((stereoVolume & 0xFFFF) / (float)0xFFFF); }