Category: | Audio Related Programs |
Author/Contact Info | Perforin perforin@warezmail.net |
Description: | Little script which plays mp3,wav,wma and midi files! |
This is actually version 2!
When you start the script, it will show you how to use it.
Itīs very simple... and oldschool :P
#!/usr/bin/perl # ############################ # --==Oldschool Music Player==-- # # + # # Coded by Perforin | dark-codez # # + # # www.dark-codez.org # # + # # Join the dark side of coding! # ############################# my $version = 2.0; use Win32::MediaPlayer; if (@ARGV < 1) { print " \n +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+\n"; print " |O|l|d|s|c|h|o|o|l| |P|l|a|y|e|r|\n"; print " +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+\n\n\n"; print " +-+-+-+-+-+-+SyNtaX+-+-+-+-+-+-+\n\n"; print " \UUsage1: \E\n"; print " perl player.pl music.mp3 100\n"; print " Play one Music-File!\n"; print " \UUsage2: \E\n"; print " perl player.pl -all C:\ 100\n"; print " Play all music files in the Directory!\n"; print " \UUsage3: \E\n"; print " perl player.pl -last \n"; print " Displays the last song!\n\n"; print " +-+-+-+-+-+-+SyNtaX+-+-+-+-+-+-+\n"; exit; } if ($ARGV[0] =~ "-last") { open(PLAYED,"<played.txt") || die print "Cannot find list!"."\n"; @PLAYED = <PLAYED>; close(PLAYED); print "\n"; print @PLAYED; exit; } elsif ($ARGV[0] =~ "-all") { my $Dir = $ARGV[1]; chomp($Direction); my $Vol = $ARGV[2]; chomp($Vol); if ($Vol =~ /a-z/ or /A-Z/) {print "Wrong Volume!\n" and exit; } chdir "$Dir"; print " \n +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+\n"; print " |O|l|d|s|c|h|o|o|l| |P|l|a|y|e|r|\n"; print " +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+\n\n"; print " BE OLDSCHOOL! USE OLSCHOOL PLAYER \n\n\n"; print " AND FEEL THE SOUND OF YOUR BLACK BOX!\n\n\n"; foreach $music (<*.mp3>,<*.wma>,<*.wav>,<*.midi>) { open(PLAYED,">played.txt"); $winmm = new Win32::MediaPlayer; $winmm->load("$music"); $winmm->play; $winmm->volume($Vol); $winmm->seek('00:00'); print " Oldschool Player plays: $music\n\n"; print PLAYED "$Direction"."\n"; my $i = 1; print ' Total Length : '.$winmm->length(1),$/; while($winmm->pos(1) != $winmm->length(1)) { print ' Now Position: '.$winmm->pos(1)."\r"; $i++ } $winmm->close; print " \n\n\n Track finished! \n\n\n"; close(PLAYED); } } else { my $Direction = $ARGV[0]; chomp($Direction); my $Volume = $ARGV[1]; chomp($Volume); if ($Volume =~ /a-z/ or /A-Z/) {print "Wrong Volume!\n" and exit; } print " \n +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+\n"; print " |O|l|d|s|c|h|o|o|l| |P|l|a|y|e|r|\n"; print " +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+\n\n"; print " BE OLDSCHOOL! USE OLSCHOOL PLAYER \n\n\n"; print " AND FEEL THE SOUND OF YOUR BLACK BOX!\n\n\n"; open(PLAYED,">played.txt"); $winmm = new Win32::MediaPlayer; $winmm->load("$Direction"); $winmm->play; $winmm->volume($Volume); $winmm->seek('00:00'); print " Oldschool Player plays: $Direction\n\n"; print PLAYED "$Direction"."\n"; my $i = 1; print ' Total Length : '.$winmm->length(1),$/; while($winmm->pos(1) != $winmm->length(1)) { print ' Now Position: '.$winmm->pos(1)."\r"; $i++ } $winmm->close; print " \n\n\n Track finished! \n\n\n"; close(PLAYED); } |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Music-Player
by jdporter (Paladin) on Aug 29, 2007 at 22:35 UTC | |
by dbw (Beadle) on Sep 04, 2007 at 22:03 UTC | |
by jdporter (Paladin) on Sep 05, 2007 at 03:16 UTC | |
by Polyglot (Chaplain) on Jun 11, 2009 at 11:56 UTC |