How is duration calculated?

We are using the API to upload items to the DB however I’m having troubles with the duration.

How does mAirList calculate the duration of a file?

If I use mediainfo or similar, sometimes the duration compared to mAirList is 1-2 seconds out, abd whilst not the worlds biggest problem, I’d rather they match…

I’ve tried uploading without a duration, however it seems that the upload process doesn’t calculate this itself and that I’d have to try playing out the file first for a duration to be populated.