Identify the bitrate of the file. If it is an audio file, it will have an audio bitrate. If it is a video file, it will have an audio bitrate and a video bitrate.
Divide the bitrate values by 8. This converts the rates from bits per second to bytes per second.
Convert the total length of the file to seconds. If the total time is in minutes, multiply it by 60 to convert it to seconds. If it is in hours, multiply it by 360 to convert it to seconds.
Multiply the total seconds from Step 3 by the bytes-per-second rate from Step 2. This is the total file size in bytes. For video files, sum the total audio size and total video size to get the total file size. Optionally, divide the total file size by 1,000 to yield the size in kilobytes (KB) or by 1,000,000 to yield the file size in megabytes (MB).