Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: sound playmedia
Thanks in advance.
One trick is to....
ErrorMode(@OFF) LastError() PlayMedia("Status WaveForm Ready") ErrorMode(@CANCEL) if LastError()!=1193 Message("Sound","Windows multimedia extensions present.") else Message("Sound","No sound") endif
Or
Here's some code I wrote to determine if there is a sound device in the system.
It is a function that returns a false if there is no card, or a true if there is one and it's status is OK.
;Determine if the system has a sound card... #DefineFunction SoundPresent() OriginalMode = ErrorMode(@OFF) SoundPresentRet = @FALSE Locator = ObjectOpen("WbemScripting.SWbemLocator") Service = Locator.ConnectServer("","root/cimv2","","") SoundCards = Service.InstancesOf("Win32_SoundDevice") hEnum = ObjectCollectionOpen(SoundCards) objSoundCard = ObjectCollectionNext(hEnum) While objSoundCard != 0 If objSoundCard.Status == "OK" Then SoundPresentRet = @TRUE objSoundCard = ObjectCollectionNext(hEnum) EndWhile ObjectCollectionClose(hEnum) ObjectClose(Service) ObjectClose(Locator) ErrorMode(OriginalMode) Return SoundPresentRet #EndFunction
Article ID: W13217
Filename: Find Sound Capabilities.txt
File Created: 2003:10:21:12:53:08
Last Updated: 2003:10:21:12:53:08