forum

Retrieving the length of the beatmap from the .osu file?

posted
Total Posts
3
Topic Starter
KillBottt
I'm making a program that cleans the song folder from any unwanted beatmaps, empty folders and duplicates.
(If anyone is interested, tell me in the comments and I'll post a download here when it's done)
One of the filters I want to add is the min/max length of the song.
(since most short songs are trash and most long songs take up a lot of space)
Is there any information in the .osu files with which I can retrieve the length of the actual beatmap?
Or any other methodes to do so? (maybe a 3th party software/library?)
Thanks in advance,

KillBottt
lewski
All hit objects have a timestamp in milliseconds in the .osu file, so you could get the map's length by calculating the time between the first object and the last. The drawback is that this method disregards the length of the last object, so a 2:01 map with a three-second slider at the end will be seen as having a length of 1:58. You could also just get the length of the mp3 (probably with a 3rd party library), but that doesn't take the possibly unmapped intro and outro into account.
Topic Starter
KillBottt

lewski wrote:

All hit objects have a timestamp in milliseconds in the .osu file, so you could get the map's length by calculating the time between the first object and the last. The drawback is that this method disregards the length of the last object, so a 2:01 map with a three-second slider at the end will be seen as having a length of 1:58. You could also just get the length of the mp3 (probably with a 3rd party library), but that doesn't take the possibly unmapped intro and outro into account.

Did it with your info.
Thanks!
Please sign in to reply.

New reply