How can i calculate the kbps & khz of a file?

Started by ultramax,

ultramax

Can someone give me a piece of code in Delphi to teach me to get the Kbps and Khz of a file (mp3, ogg, wma, wav), please?!

I've tried once to translate a piece o C code but i failed!

Thanks!
UltraMAX

Irrational86

To get the khz, find out about the BASS_ChannelGetAttributes function, it will return you the freq (in hz, so you divide by 1000 and you get khz).

And this way to get kbps:
BitRate := Round(BASS_StreamGetFilePosition(strm, 2) * 8 / BASS_ChannelBytes2Seconds(strm, BASS_StreamGetLength(strm)) / 1000);