|
|
Subject:
Automating Windows Media Player 10
Category: Computers > Programming Asked by: trw-ga List Price: $20.00 |
Posted:
28 Nov 2005 10:41 PST
Expires: 02 Feb 2006 18:52 PST Question ID: 598585 |
I need the ability to play tunes (wma files) in Windows Media Player 10 with some silence between each tune. Simply playing from a playlist results in one tune immediately following another; I want a couple of seconds between them at least. So what I figure I need is a batch file or script that will plow through a folder and individually submit each wma file in it for playback in WMP10, with a 2 second delay between each. | |
| |
|
|
There is no answer at this time. |
|
Subject:
Re: Automating Windows Media Player 10
From: kasimirgabert-ga on 28 Nov 2005 20:18 PST |
I built a script that should do (as far as I know) exactly what you want it to. -- How to use it -You need to have Perl installed (if you are using Windows install ActivePerl) -Create a file called pause.wma inside of your folder, and make it the length that you want the pause to be -Double click the pauselist.pl file -Open up the .asx file inside of Windows Media Player -- Options -If you want the pause file to be called something other than pause.wma, then inside of your command prompt you should sent the argument with the name of the file, for example type "pauselist.pl lengthpause.wav". -- The script *********************************** #!/usr/bin/perl #Developed by Kasimir Gabert #11/28/05 use warnings; use strict; my $pausefile = $ARGV[0]; if ($pausefile eq "") { $pausefile = "pause.wma"; } $| = 1; open (my $asxfile, ">", "pauseplaylist.asx"); print $asxfile '<ASX version = "3.0">' . "\n"; print $asxfile '<!--A simple playlist with entries to be played in sequence with pauses.-->' . "\n"; print $asxfile ' <Title>Paused Playlist</Title>' . "\n"; print "Creating Pause Playlist:\n"; my @files = glob("*"); foreach my $file (@files) { unless ($file eq "pauselist.pl" || $file eq $pausefile || $file eq "pauseplaylist.asx") { print $asxfile ' <Entry>' . "\n"; print $asxfile ' <Ref href = "' . $file . '" />' . "\n"; print $asxfile ' </Entry>' . "\n"; print $asxfile ' <Entry>' . "\n"; print $asxfile ' <Ref href = "' . $pausefile . '" />' . "\n"; print $asxfile ' </Entry>' . "\n"; print "#"; } } print $asxfile "</ASX>"; close ($asxfile); __END__ *********************************** That should work for you. If you have any problems then just add another comment and I will see what I can do. |
Subject:
Re: Automating Windows Media Player 10
From: trw-ga on 29 Nov 2005 10:28 PST |
Very close! I placed the script file in Windows\System32 folder. It produces the desired result but also generates an error message. I'll paste it below. C:\Documents and Settings\trw\Desktop\My Muzic>pauselist.pl Use of uninitialized value in string eq at C:\WINDOWS\system32\pauselist.pl line 10. Creating Pause Playlist: ##### |
Subject:
Re: Automating Windows Media Player 10
From: kasimirgabert-ga on 29 Nov 2005 13:55 PST |
Hello, I have no idea why that problem is occuring on your computer. It appears that there is either a non string argument, or the test for an argument is not working. Tell me if this script produces the same effect without an error message: ********** #!/usr/bin/perl #Developed by Kasimir Gabert #11/28/05 use warnings; use strict; my $pausefile = "pause.wma"; $| = 1; open (my $asxfile, ">", "pauseplaylist.asx"); print $asxfile '<ASX version = "3.0">' . "\n"; print $asxfile '<!--A simple playlist with entries to be played in sequence with pauses.-->' . "\n"; print $asxfile ' <Title>Paused Playlist</Title>' . "\n"; print "Creating Pause Playlist:\n"; my @files = glob("*"); foreach my $file (@files) { unless ($file eq "pauselist.pl" || $file eq $pausefile || $file eq "pauseplaylist.asx") { print $asxfile ' <Entry>' . "\n"; print $asxfile ' <Ref href = "' . $file . '" />' . "\n"; print $asxfile ' </Entry>' . "\n"; print $asxfile ' <Entry>' . "\n"; print $asxfile ' <Ref href = "' . $pausefile . '" />' . "\n"; print $asxfile ' </Entry>' . "\n"; print "#"; } } print $asxfile "</ASX>"; close ($asxfile); __END__ ********** I hope that this works, Kasimir Gabert |
Subject:
Re: Automating Windows Media Player 10
From: trw-ga on 29 Nov 2005 15:52 PST |
No errors with the new version. What did you change or eliminate? |
Subject:
Re: Automating Windows Media Player 10
From: kasimirgabert-ga on 29 Nov 2005 18:21 PST |
I just eliminated the test for whether or not $ARGV[0] exists. It was working on my computer, but for some reason the if ($ARGV[0]) { ... } was actually trying to access the location behind the NULL pointer for @ARGV, and the "use warnings;" was showing the "warning". I am not sure why this was happening on your computer, but I am glad that this is working for you now. |
Subject:
Re: Automating Windows Media Player 10
From: trw-ga on 29 Nov 2005 19:59 PST |
Kasimir, You deserve the payment. Please do whatever it is that turns your comment into an answer. I appreciate your help! Tim |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |