Milliseconds to HH:mm:ss function

Beatport have this property "length": 779986

I wonder is it too much to ask @Florian for a math fn to convert milliseconds to HH:mm:ss?

Thanks. I hope this is the last request.


This is to display a human-readable length in my TRACK scripts in the List of search results... dialog.

can't you use something like this, but adapt it to the json output obviously.

$div(%_length_seconds%,60):$num($mod(%_length_seconds%,60),2)

Just trying to think what would be already implementable with current functions.

I'm currently working on a dedicated function for that, both for standard scripting and the web sources framework.

2 Likes

This is now part of Mp3tag v3.21b as a new function SayDuration which is not limited to JSON-handling, but can also be used in other contexts.

It takes the current input, interprets it as a numerical value and outputs a formatted duration string. It assumes to get the input in seconds, but can be switched to milliseconds via the optional second parameter "ms"

SayDuration "ms"

1 Like