Solved

Checking a computer has a sound card programatically

Posted on 2004-08-16
2
203 Views
Last Modified: 2010-05-18
I have written a program using vb.net and the framework that plays a video, however if the user mutes the sound on a video when they do not have a sound card installed it generates an error.

Can someone tell me how to check a sound card exists before attempting to mute the sound.

Bot
0
Comment
Question by:LenBot
2 Comments
 
LVL 48

Accepted Solution

by:
Mikal613 earned 500 total points
ID: 11814276
Private Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Long
Private Sub cmdCanPlay_Click()
    Dim i As Long
    i = waveOutGetNumDevs()
    If i > 0 Then
        MsgBox "Your system can play sound files.", _
        vbInformation, "Sound Card Test"
    Else
        MsgBox "Your system can not play sound Files.", _
        vbInformation, "Sound Card Test"
    End If
End Sub
0
 

Author Comment

by:LenBot
ID: 11814459
Nice one thanks for  the quick responce.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question