For Programmers: Free Programming Magazines  


Home > Archive > VBScript > November 2004 > Playing sounds?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Playing sounds?
Dennis

2004-11-29, 3:59 pm

What is the simplest way to play a WAV file from vbscript?

Dennis


McKirahan

2004-11-29, 3:59 pm

"Dennis" <junk@galron.com> wrote in message
news:uyztA6Q1EHA.1652@TK2MSFTNGP11.phx.gbl...
> What is the simplest way to play a WAV file from vbscript?
>
> Dennis


Option Explicit
Const cRUN = "sndrec32 /play /close "
Const cWAV = "%windir%\media\ding.wav"
Dim objWSS
Set objWSS = CreateObject("Wscript.Shell")
objWSS.Run cRUN & Chr(34) & cWAV & Chr(34),0,True
Set objWSS = Nothing


Dennis

2004-11-29, 3:59 pm

Thanks!

Dennis

"McKirahan" <News@McKirahan.com> wrote in message
news:xJkqd.679334$8_6.509561@attbi_s04...
> "Dennis" <junk@galron.com> wrote in message
> news:uyztA6Q1EHA.1652@TK2MSFTNGP11.phx.gbl...
>
> Option Explicit
> Const cRUN = "sndrec32 /play /close "
> Const cWAV = "%windir%\media\ding.wav"
> Dim objWSS
> Set objWSS = CreateObject("Wscript.Shell")
> objWSS.Run cRUN & Chr(34) & cWAV & Chr(34),0,True
> Set objWSS = Nothing
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com