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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto play wav file in wplayer from script

Status
Not open for further replies.

Cambridge10

Programmer
May 5, 2008
18
NL
Hi,

I've a wav file which should be automatically played with Windows Media Player but it doesn't.
Code:
$wmp_path = "C:/Program Files/Windows Media Player/wmplayer.exe";
$wmp_path =~ s/\//\\/g; #convert / to \
system ($wmp_path external.wav);

Windows Media Player is automatically started but it doesn't play the file.
Who's got an idea?
 
I've found out that wmplayer.exe /play extern.wav will auto play the file from commandline.
How do I pass /play within my scipt?

Code:
system ($wmp_path /play external.wav);

It throws the message "Search pattern not terminated"

How do I solve this?
 
$wmp_path /play external.wav"
or \/ if that doesn't work

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
I've already tried that but it doesn't work.
Btw I'm using Perl Tk.
 
You're not using quotes in your system call.

Code:
system ($wmp_path /play external.wav);

should be

system ("$wmp_path /play external.wav");

-------------
Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b";print$i++%2?"/":"_";goto x;'
 
I've figured out what going wrong.
I used print to see what Perl is doing and when changing to the directory of wmplayer it goes wrong.
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top