This VBS Script combines the textToSpeech script
with the openCDtray script. The computer will say "This is your computer speaking. I'm hungry for a CD."
Then the cd tray will open for four seconds then close. This program should run on any computer running microsoft windows version Windows 98 or newer.
There are more VBS Scripts on the VBS Scripts page.
- Set oWMP = CreateObject("WMPlayer.OCX.7" )
- Set colCDROMs = oWMP.cdromCollection
- Dim var1
- var1 = "This is your computer speaking, I'm hungry for a CD."
- set sapi = wscript.createobject("SAPI.Spvoice")
- Sapi.speak var1 'this line tells the computer to speak the text in the variable var1'
- colCDROMs.Item(1).Eject 'open cd tray'
- WScript.Sleep 4000 'wait 4 seconds'
- colCDROMs.Item(1).Eject 'close cd tray'