public static int GetPlaybackIdent() { String q = Settings.GetReg <String>("vc_play_device", String.Empty); for (int i = 0; i < waveOutGetNumDevs(); i++) { WaveCaps w = new WaveCaps(); waveOutGetDevCaps(i, ref w, Marshal.SizeOf(typeof(WaveCaps))); String str = w.szPname; if (str.IndexOf("\0") > -1) { str = str.Substring(0, str.IndexOf("\0")); } if (str.Length > 0) { if (str == q) { return(i); } } } return(0); }
public static String[] GetRecordDevices() { List <String> list = new List <String>(); for (int i = 0; i < waveInGetNumDevs(); i++) { WaveCaps w = new WaveCaps(); waveInGetDevCaps(i, ref w, Marshal.SizeOf(typeof(WaveCaps))); String str = w.szPname; if (str.IndexOf("\0") > -1) { str = str.Substring(0, str.IndexOf("\0")); } if (str.Length > 0) { list.Add(str); } } return(list.ToArray()); }
private static extern uint waveOutGetDevCaps(int uDeviceID, ref WaveCaps lpCaps, int uSize);