Assuming it's not a variable bit rate mp3 you can strip the bitrate out
of the header and then do the math, just use low level file IO in C (or
some less useful language ;-), the actual file format should be
available somewhere on the net so you'll know how to parse it.
Later,
Ben.