Checking for sound cards

Blitz3D Forums/Blitz3D Programming/Checking for sound cards

Berbank(Posted 2004) [#1]
Does anyone know of a way to check if there is a sound card connected. Cardless players are getting error messages when trying to run the game.
Trying to get more information on error message now


Rottbott(Posted 2004) [#2]
Yes, if a sound doesn't load (the LoadSound() function returns 0), it means that no sound card is present (assuming the file you are trying to load does exist).

The sound functions are not meant to cause an error, even if you pass 0 to them instead of a valid loaded sound, so you shouldn't really have to detect whether a card is present or not.


GNS(Posted 2004) [#3]
http://www.blitzbasic.com/codearcs/codearcs.php?code=264


Rob(Posted 2004) [#4]
It would be so much cleaner if Blitz merely cancelled playback if card not present.


Berbank(Posted 2004) [#5]
Excellent, thanks guys.