public static AudioDeviceCollection PlayBackDevices() { AudioDeviceCollection c=new AudioDeviceCollection(); for(int i=0;i<waveOutGetNumDevs();i++) { WAVEOUTCAPSA a=new WAVEOUTCAPSA(); waveOutGetDevCapsA(i,ref a,System.Runtime.InteropServices.Marshal.SizeOf(typeof(WAVEINCAPSA))); AudioDevice b=new AudioDevice(); b.dwFormats=a.dwFormats; b.szPname=a.szPname; b.wPid=a.wPid; b.wMid=a.wMid; b.vDriverVersion=a.vDriverVersion; b.wChannels=a.wChannels; b.wReserved1=a.wReserved1; c.Add(b); } return c; }
public static AudioDeviceCollection PlayBackDevices() { AudioDeviceCollection c = new AudioDeviceCollection(); for (int i = 0; i < waveOutGetNumDevs(); i++) { WAVEOUTCAPSA a = new WAVEOUTCAPSA(); waveOutGetDevCapsA(i, ref a, System.Runtime.InteropServices.Marshal.SizeOf(typeof(WAVEINCAPSA))); AudioDevice b = new AudioDevice(); b.dwFormats = a.dwFormats; b.szPname = a.szPname; b.wPid = a.wPid; b.wMid = a.wMid; b.vDriverVersion = a.vDriverVersion; b.wChannels = a.wChannels; b.wReserved1 = a.wReserved1; c.Add(b); } return(c); }
private extern static int waveOutGetDevCapsA(int uDeviceID, ref WAVEOUTCAPSA pwoc, int cbwoc);
private extern static int waveOutGetDevCapsA(int uDeviceID,ref WAVEOUTCAPSA pwoc,int cbwoc);