#!/usr/bin/perl
use strict;
use warnings;
use MP3::M3U::Parser;
# use Data::Dumper;
print "Read MP3 Test file \n";
my $parser = MP3::M3U::Parser->new(-seconds => 'mm:ss');
$parser->parse("/home/rgammon51/Documents/Playlist.m3u")->export (-ove
+rwrite => 1);
my $result = $parser->result;
my %info = $parser->info;
printf "Number of Songs in this list :: %s\n ", $info{songs};
printf "Total Time to play all songs :: %s\n ", $info{ttime};
printf "Average Time of all songs :: %s\n ", $info{average};
This ending part does not generate mm:ss results The formatted time only appears in the html file.
My goal, ultimately, is to use this module to generate a shell script to update the contents of my mp3 player that I carry around daily. it is a cheap player that does not implement shuffle, so I must update its contents periodically with new material, and most importantly in a different order.
This code uses your hint as to how to proceed. however, the screen output from printf is just seconds, not hh:mm:ss.
This appears to be a characteristic of the code in the CPAN module, and to change it, I must modify the source. |