Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WaveOutEvent device capabilities #1125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions NAudio.WinMM/WaveOutEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,24 @@ public WaveOutEvent()
waveOutLock = new object();
}

/// <summary>
/// Returns the number of Wave Out devices available in the system
/// </summary>
public static int DeviceCount => WaveInterop.waveOutGetNumDevs();

/// <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)
{
var caps = new WaveOutCapabilities();
var structSize = Marshal.SizeOf(caps);
MmException.Try(WaveInterop.waveOutGetDevCaps((IntPtr)devNumber, out caps, structSize), "waveOutGetDevCaps");
return caps;
}

/// <summary>
/// Initialises the WaveOut device
/// </summary>
Expand Down