Yes, I can try to read ID3 tag, but server receives music from random people and it's unreliable. I can also find blocks count and find len then, but it's so stupid. My inner perfectionist doesn't want to do it this way :)
I need accuracy to the minutes (many Gbytes of music)
Well if you have a VBR encoded MP3 and can't rely on ID3 Tags (which you usually can't even if they are present), you need to calculate it yourself:
I would probably just use "sox file.mp3 -n stat" and parse the result (slow but may include other interesting data):
sox song.mp3 -n stat
Samples read: 45838080
Length (seconds): 519.706122
Scaled by: 2147483647.0
Maximum amplitude: 1.000000
Minimum amplitude: -1.000000
Midline amplitude: -0.000000
Mean norm: 0.178515
Mean amplitude: -0.000111
RMS amplitude: 0.247510
Maximum delta: 1.810621
Minimum delta: 0.000000
Mean delta: 0.156194
RMS delta: 0.212604
Rough frequency: 6028
Volume adjustment: 1.000
I also found some python code on topic here: http://www.thecodingforums.com/threads/mp3-vbr-frame-length-in-time.339001/