0

i use a sound player in my winform application. Is there a way to check for sound cards driver (is installed/or not installed)on OS? i want to chek it programatelly in c#

1 Answer 1

1

i got it

using System.Runtime.InteropServices;

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

private void frmSound_Load(object sender, System.EventArgs e){
if(waveOutGetNumDevs() != 0)
{
  lblSound.Text = "The Sound device is detected for this system";
}
else
{
    lblSound.ForeColor = Color.Red; 
    lblSound.Text = "The Sound device is Not Found for this system";
}
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.