473,396 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 4485
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: The Road To Utopia | last post by:
Here's one for the trolls...a common jibe from them is setting up audio/video hardware under linux. Ok, true story: at work today, someone asked me if I could tell him why his XP Home would play...
1
by: Uzi Baruch | last post by:
Hi! is there a way through the .NET framework, to check if a sound card exists on a local computer. Thanks,
4
by: Robert Gravereaux | last post by:
I'm putting together a C# .Net forms project on win2k. The application requires some sort of horn sound. I've never implemented any audio in .Net, so I'm not sure how best to accomplish this. ...
3
by: June Li | last post by:
H I got a problem with detecting sound card with Windows x I use SDK function waveInGetNumDevs() to test if there is a sound card. But even if there is no sound card installed, the function...
0
by: June Li | last post by:
H I got a problem with detecting sound card with Windows xp I am working on an application to test microphone. First I need detect if there is a sound card installed (or integrated audio...
3
by: larry | last post by:
Hi, my friends, My boss asked me to use sound card to do analog to digital conversion for my application. I know when we record sound, sound card changes anolog signal to digital file. I have no...
7
tpgames
by: tpgames | last post by:
I know that an internal sound card has to be one listed as for a specific mother board. However, does this rule apply to external sound cards? I use a satellite A75-s2112 toshiba laptop, intel pent...
3
by: =?Utf-8?B?SlZE?= | last post by:
In my system, i have two sound card installed. I am developing one multimedia application in c# using DirectShow. I want to select particular sound card and play one audio file and, play another...
2
by: lazzypink | last post by:
hi guys! i having a problem in my project which is create a media player and let the user choose the sound card for audio output. Let say i have 2 sound card in my computer, i want to select the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.