Solved

Checking a computer has a sound card programatically

Posted on 2004-08-16
2
201 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now