|
-
Jul 25th, 2002, 08:44 PM
#1
Thread Starter
Hyperactive Member
Detecting whether a user has a sound card
Hi, my app plays sound as part of its functionality, but a lot of my users don't have sound cards. Is there some way to detect whether or not they have one, to avoid an automation error when i try to play sound?
Thanx all for helping,
We don't know what's wrong. . . So the best bet might be to remove something surgically.
-
Jul 25th, 2002, 10:51 PM
#2
Thread Starter
Hyperactive Member
We don't know what's wrong. . . So the best bet might be to remove something surgically.
-
Jul 25th, 2002, 11:11 PM
#3
How are you playing the sounds? API? Can't you trap for the error, and if you get it, discontinue the sounds?
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Jul 25th, 2002, 11:42 PM
#4
Addicted Member
You can detect a sound-card using APIs. Here's the code ....
Declare Function waveOutGetNumDevs Lib "winmm.dll" Alias "waveOutGetNumDevs" () As Long
Dim i As Integer
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
Knowledge is static .... understanding is Dynamic
-
Jul 25th, 2002, 11:43 PM
#5
Thread Starter
Hyperactive Member
i'm using the media player component, and i don't want to trap the error everytime i try to play a sound, i want to check the system at the start of the prog and set a no sound flag if it fails. I could do it crudely using a mediaplayer component on the startup form and if i get an error, set the flag, but i don't really want to do it that way. I thought maybe there was an api or some method to check for installed devices
We don't know what's wrong. . . So the best bet might be to remove something surgically.
-
Jul 25th, 2002, 11:44 PM
#6
Thread Starter
Hyperactive Member
Typical, someone always posts exactly what you are looking for when you are explaining what it is you want. Thanks hamin, i'll try your code now.
We don't know what's wrong. . . So the best bet might be to remove something surgically.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|