示例#1
0
        /// <summary>
        /// Gets audio output volume.
        /// </summary>
        /// <param name="left">Left channel volume level.</param>
        /// <param name="right">Right channel volume level.</param>
        /// <exception cref="ObjectDisposedException">Is raised when this object is disposed and this method is accessed.</exception>
        public void GetVolume(ref ushort left, ref ushort right)
        {
            if (m_IsDisposed)
            {
                throw new ObjectDisposedException("WaveOut");
            }

            int volume = 0;

            WavMethods.waveOutGetVolume(m_pWavDevHandle, out volume);

            left  = (ushort)(volume & 0x0000ffff);
            right = (ushort)(volume >> 16);
        }