Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

interesting application! i think. 1

Status
Not open for further replies.

barny2006

MIS
Mar 30, 2006
521
US
hi there,
has anybody ever had an application to play a sound file such as .wav file from a vbs?
if so, how would it be done?
our application is for a hardware store, that wants to use their pc to sound a wave file every 10 minutes or so anouncing items. the .wav file is already recorded. anybody has any idea?
 
A starting point:
CreateObject("WScript.Shell").Run Chr(34) & "\path\to\file.wav" & Chr(34), 0, False

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
i tried this. it worked fine on one machine. it brings up windows media player. and doesn't play one long file to the end. it cuts it off half way through.
when i tried it in another machine, with windows media player 10.0, it kept playing the .wav file to the end, and kep repeating it over and over again.
is there a way to overcome 1) not opening media player, and 2) from playing it over and over on media player 10.0?
 
playing it over and over
I guess this is an option to untick in the WMP menus.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
WMP 10 kind of hid the file menu. It’s now an upside down triangle next to the minimize button. If you click on it and then click play, there is a repeat option make sure it is not checked. Pressing CTRL+T will toggle it off and on also.
 
thanks phv and midwest.
it's workign ok. now, i'm trying to have this play all day every 5 minutes or so. with and endless loop while hour(time()) between 08 and 19. can this be done like this:

do while hour(time()) >= 8 and hour(time()) <= 19
a = minute(time())
if right(a,1) = "0" or right(a,1) = "5" then
CreateObject("WScript.Shell").Run Chr(34) & _
"c:\anouncements\anounce_file.wav\" & _
sounds(i) & Chr(34), 0, False
wscript.sleep 4000
end if
loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top