Author Topic: Calculate the Bitrate  (Read 185 times)

Ed1966

  • Posts: 230
Calculate the Bitrate
« on: 27 Jan '23 - 13:20 »
Hi  ;)

You can read the Bitrate from the Header of an mp3 song, but it can also be wrong. There are programs for that that can calculate that.
How can I calculate the Bitrate myself via BASS to compare this?
Or does it always give the same result.
Only needed for mp3 songs.

Regards,
Eduard.

Ian @ un4seen

  • Administrator
  • Posts: 24941
Re: Calculate the Bitrate
« Reply #1 on: 27 Jan '23 - 14:55 »
If you include the BASS_STREAM_PRESCAN flag in your BASS_StreamCreateFile call, it will pre-scan the entire MP3 file for the exact length, and you can then get the average bitrate from BASS_ChannelGetAttribute with BASS_ATTRIB_BITRATE.

Ed1966

  • Posts: 230
Re: Calculate the Bitrate
« Reply #2 on: 28 Jan '23 - 20:14 »
Thank you  :)

Ed1966

  • Posts: 230
Re: Calculate the Bitrate
« Reply #3 on: 3 Feb '23 - 07:47 »
That's working fine but...

How can I detect the real bitrateof a mp3 song like fakinthefunk or comparable software?
https://fakinthefunk.net/en/

Maybe you have some starting points?
Or is this a complicated process and should I leave it to the experts.

Or sample source (snippet) how to detect the highest frequency per song? That the way the do this? I think?

Regards,
Eduard.
« Last Edit: 7 Feb '23 - 08:54 by Ed1966 »

saga

  • Posts: 2642
Re: Calculate the Bitrate
« Reply #4 on: 12 Feb '23 - 19:07 »
There's several softwares that can do this, but the fact that they all more or less keep it a secret how they work in detail should probably be quite telling. While a steep cutoff in the frequency spectrum can be a telltale sign of a low-quality MP3, it will not be enough to identify them. Often MP3 encoders will change this cutoff depending on the complexity of the song (or even just parts of it), so parts of a file might use the full spectrum while others have a 16kHz cutoff. Unless you are ready to learn all the theory behind MP3 and analyze the output of different MP3 encoders, "leaving it to the experts" might be the wisest choice. There's some very incomplete information on how Aucdtect does this: http://tausoft.org/wiki/True_Audio_Checker_Algorithm
If you need a free program that uses this algorithm and can also batch-check files like the program you linked, check out Audiochecker: https://archive.org/details/Audiochecker.v2.0.Beta.Build.457