Esempio n. 1
0
        /// <summary>
        /// Gets the sound devices from winmm.dll and return as IEnumerable&lt;System.String&gt;.
        /// </summary>
        /// <returns>IEnumerable&lt;System.String&gt;.</returns>
        public IEnumerable<string> GetDeviceNames()
        {
            var caps = new WaveCapabilities();

            var devices = GetNumberOfInputDevices();
            for (uint i = 0; i < devices; i++)
            {
                GetInputDeviceCapabilities(i, ref caps, (uint) Marshal.SizeOf(caps));
                yield return caps.ToString();
            }

            devices = GetNumberOfOutputDevices();
            for (uint i = 0; i < devices; i++)
            {
                GetOutputDeviceCapabilities(i, ref caps, (uint) Marshal.SizeOf(caps));
                yield return caps.ToString();
            }
        }
Esempio n. 2
0
 private static extern int GetOutputDeviceCapabilities(uint hwo, ref WaveCapabilities waveCaps, uint cbwoc);