How to enumerate audio out devices in c#

后端 未结 5 1910
小蘑菇
小蘑菇 2020-11-30 11:56

I would like to know how to get a list of the installed audio out devices (waveOut) on a machine

OS: Windows (XP, Vista, 7) Framework: .Net 3.5 Language: c#

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 12:08

    Check waveOutGetNumDevs API

    [DllImport("winmm.dll", SetLastError = true)]
    public static extern uint waveOutGetNumDevs();
    

    Returns the number of devices. A return value of zero means that no devices are present or that an error occurred. http://msdn.microsoft.com/en-us/library/dd743860(v=vs.85).aspx

提交回复
热议问题