You need to find Mpeg Header (it may goes after little offset from file beginning and after ID3V2 Tag in mp3 file)
After you should read the header - 4 bytes
Header[4]
byte _version = (byte)((Header[1] & 0x18) >> 3);
byte _layer = (byte)((Header[1] & 0x06) >> 1);
byte _freqIndex = (byte)((Header[2] & 0x0C) >> 2);
You got Frequency index
_freqIndex
and Mpeg Version
_version
which you can use according next table to get rate in Hz.
Sampling rate frequency index (values are in Hz)
bits MPEG1 MPEG2 MPEG2.5
00 44100 22050 11025
01 48000 24000 12000
10 32000 16000 8000
11 reserv. reserv. reserv.
For more information see information abt Mpeg3 header format next articles will helps you:
MPEG Audio Frame Header[
^]
http://mpgedit.org/mpgedit/mpeg_format/MP3Format.html[
^]
Regards,
Maxim.