For most audio files, the correct bitrate is in the file header, and various utilities can just read and give you that info.
e.g.
MediaInfoBut some files have none or incorrect info.
e.g. one has
Complete name : G:\Torrents\x\x.mp3 Format : MPEG Audio
Format : MPEG Audio File size : 127 MiB
File size : 127 MiB Overall bit rate mode : Variable
Overall bit rate mode : Variable
-- i.e., no duration or bitrate.
You can fix that, e.g. for MP3s by just opening and resaving the file using
MP3DirectCut, which rewrites the header correctly but does not reencode the audio.
Now MediaInfo says:
Complete name : G:\Torrents\x\x2.mp3 Format : MPEG Audio
Format : MPEG Audio File size : 127 MiB
File size : 127 MiB Duration : 6h 9mn
Duration : 6h 9mn Overall bit rate mode : Constant
Overall bit rate mode : Constant Overall bit rate : 48.0 Kbps
Or you can calculate it from 1st principles:
bitrate == number of bits per second.
b=F*8/tb = bitrate in kb/sec
F = filesize in bytes (8 bits = 1 byte, thus the 8)
t = duration in seconds.
The file above is 132,926,231 bytes
duration is 6h9min = 369*60 sec (you can read the time from audioplayers like e.g. VLC)
so b = 48031 = 48kbps