Results 1 to 6 of 6

Thread: Detecting whether a user has a sound card

  1. #1

    Thread Starter
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349

    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.

  2. #2

    Thread Starter
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349
    *bump*
    We don't know what's wrong. . . So the best bet might be to remove something surgically.

  3. #3
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    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

  4. #4
    Addicted Member hamins's Avatar
    Join Date
    Sep 2001
    Posts
    192
    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

  5. #5

    Thread Starter
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349
    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.

  6. #6

    Thread Starter
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349
    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
  •  



Click Here to Expand Forum to Full Width