Bulk rename using wav length property?

Hello, I haven't used the Advanced Renaming feature much, but it looks fairly intuitive...

I have about 80 .wav files in a folder. They have totally different names (ringtones and such). I also have a column in my lister showing the duration/length of each file. I'd like to put those lengths (without the zero padding) as a suffix to the existing file name.

For example:
car_brake_crash.wav (length is 0:07) rename to car_brake_crash-7sec.wav
zippi1__sound-singing.wav (length is 0:02) rename to zippi1__sound-singing-2sec.wav
crank_ringtone.mp3 (length is 0:13) rename to crank_ringtone-13sec.mp3

Is there a way set up a macro the "pushes" the metadata into the file name? Are there any bored gurus that would be willing to generate some VBScript for this?

Thanks All.

Yes !
This isn't going to be very hard to do at all.
To get what you want in the form you want will take a little more work, a new Evaluator Column for instance.

At first glance, you can get a quick start on this using the column keyword mp3songlength for duration .
Yes, it is a little confusing. The keyword includes the prefix mp3, but it really is for all recognized music files.

Edit: Could you be specific as to how you would like the duration displayed ?
That would help us get this right the first time.

Cool thanks David!

For the end resutlt, my thought was to trim the zeros and have something like

oldName-7sec.wav
oldName-23sec.wav

I'm guessing the I can do a second rename to get rid of the zeros and semicolons?

How would you want it displayed if it's more than one minute or more than one hour?

Yes a second rename is one way to do that.
An evaluator column that displays the form you want it in is another way. A script as a third way.

For this particular batch of wav files, the longest one is 2:31, no need to deal with hours.

I'm not seeing how to use Evaluator Column data in there.. I need to reread the help manual...

It would then be {eval:MyColumn} instead of {mp3songlength} .

You should be able to get this value as an integer directly with the Evaluator:

{=duration as int=}

However, this seems to be broken in the Renamer context. It works in an Evaluator Column:

XML
<?xml version="1.0"?>
<evalcolumn align="0" attrrefresh="no" autorefresh="no" customgrouping="no" foldertype="all" keyword="duration2" maxstars="5" namerefresh="no" reversesort="no" title="duration2" type="2">duration as int</evalcolumn>

Here's a demo with files in

/windows\Media
{duration} ### {=duration as int=} ### {eval:duration2}

2 Likes

Excellent. Thank you both.

1 Like