Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB4/32,VB5,VB6
Expertise: beginner
Oct 2, 1999

Check whether a sound card exists

If you are developing a game in VB or an application that plays sounds, you probably want to check that a sound card actually exists. There is an API function that does this, and returns the number of sound cards installed in the system. Therefore, a return value of zero means that no devices are present or that an error occurred. This is an example:

Private Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Long

If waveOutGetNumDevs() >= 1 Then
    MsgBox "Your system supports a sound card."
Else
    MsgBox "Your system can't play sounds."
End If
Marco Bellinaso
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap