/// <summary> /// Retrieves the capabilities of a waveOut device /// </summary> /// <param name="devNumber">Device to test</param> /// <returns>The WaveOut device capabilities</returns> public static WaveOutCapabilities GetCapabilities(int devNumber) { WaveOutCapabilities caps = new WaveOutCapabilities(); int structSize = Marshal.SizeOf(caps); MmException.Try(WaveInterop.waveOutGetDevCaps((IntPtr)devNumber, out caps, structSize), "waveOutGetDevCaps"); return caps; }
/// <summary> /// Retrieves the capabilities of a waveOut device /// </summary> /// <param name="devNumber">Device to test</param> /// <returns>The WaveOut device capabilities</returns> public static WaveOutCapabilities GetCapabilities(int devNumber) { WaveOutCapabilities caps = new WaveOutCapabilities(); int structSize = Marshal.SizeOf(caps); MmException.Try(WaveInterop.waveOutGetDevCaps((IntPtr)devNumber, out caps, structSize), "waveOutGetDevCaps"); return(caps); }
public static WaveOutCapabilities GetCapabilities(int devNumber) { WaveOutCapabilities waveOutCapabilities = default(WaveOutCapabilities); int waveOutCapsSize = Marshal.SizeOf(waveOutCapabilities); MmException.Try(WaveInterop.waveOutGetDevCaps((IntPtr)devNumber, out waveOutCapabilities, waveOutCapsSize), "waveOutGetDevCaps"); return(waveOutCapabilities); }
/// <summary> /// 根据设备名称返回设备id /// </summary> /// <param name="_devicename">设备名称</param> /// <returns>返回设备id</returns> public static int getDeviceByName(string _devicename) { int _deviceid = 0; for (int deviceId = 0; deviceId < WaveOut.DeviceCount; deviceId++) { WaveOutCapabilities capabilities = WaveOut.GetCapabilities(deviceId); if (capabilities.ProductName.Contains(_devicename)) { _deviceid = deviceId; break; } } return(_deviceid); }
public static extern MmResult waveOutGetDevCaps(IntPtr deviceID, out WaveOutCapabilities waveOutCaps, int waveOutCapsSize);
public OutputDeviceModel(int n, NAudio.Wave.WaveOutCapabilities capabilities) : base(n, capabilities) { }
public OutputDevice(WaveOutCapabilities outputDevice, int deviceNumber) { _outputDevice = outputDevice; DeviceNumber = deviceNumber; }
protected DeviceModel(int wavDeviceNum, WaveOutCapabilities waveoutcapabilities) { Provider = DeviceProvider.Wave; WavDeviceNumber = wavDeviceNum; WaveOutCapabilities = waveoutcapabilities; }