471,354 Members | 1,293 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

How can I check for sound card?

Hi,
Is there a way to check for sound cards in c#? I don't want to force the
user to have DirectX9 or so, can I perhaps use winmm.dll?

Any help, and code snippets, is highly appreciated!

Thanks,
Mats-Lennart
Dec 1 '05 #1
2 4396
That's right - you need to import a winmm.dll function.
If you just want to make sure that this PC does have a sound card you
may use this:
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint waveOutGetNumDevs();
If result is non-zero then you can expect a device.

Mats-Lennart Hansson wrote:
Hi,
Is there a way to check for sound cards in c#? I don't want to force the
user to have DirectX9 or so, can I perhaps use winmm.dll?

Any help, and code snippets, is highly appreciated!

Thanks,
Mats-Lennart

--
Vit Zayko
Dec 1 '05 #2
This works fine. Thanks!

"Vitaly Zayko" <vitaly_at_zayko_dot_net> wrote in message
news:em**************@tk2msftngp13.phx.gbl...
That's right - you need to import a winmm.dll function.
If you just want to make sure that this PC does have a sound card you may
use this:
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint waveOutGetNumDevs();
If result is non-zero then you can expect a device.

Mats-Lennart Hansson wrote:
Hi,
Is there a way to check for sound cards in c#? I don't want to force the
user to have DirectX9 or so, can I perhaps use winmm.dll?

Any help, and code snippets, is highly appreciated!

Thanks,
Mats-Lennart

--
Vit Zayko

Dec 1 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

22 posts views Thread by The Road To Utopia | last post: by
1 post views Thread by Uzi Baruch | last post: by
4 posts views Thread by Robert Gravereaux | last post: by
3 posts views Thread by June Li | last post: by
reply views Thread by June Li | last post: by
tpgames
7 posts views Thread by tpgames | last post: by
3 posts views Thread by =?Utf-8?B?SlZE?= | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.