Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
1. get the filesize of an mp3 file in bytes (ls -l -R) 2. multiply the field in bytes by 8 to get bits 3. divide the results by 128000 (128kbs/sec) to get playtime in seconds 4. get the playtime in seconds and convert is to minutes (/60) 5. convert the decimal minutes to MM:SS 6. will produce an output of: "songname sizeinM time in MM:SS" recursively possibly to a file.This is what I have done using awk. (I'm new to this too)
You help is truly appreciated. Thank you.ls -l | awk '{print $5,(($5*8)/128000)/60}' | awk -F\. '{print $1, $2* +(60/100)}'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: playtime calculation
by japhy (Canon) on Jan 28, 2000 at 18:51 UTC | |
|
Re: playtime calculation
by da w00t (Sexton) on Jan 31, 2000 at 02:13 UTC |