Author Topic: How can i calculate the kbps & khz of a file?  (Read 5034 times)

ultramax

  • Posts: 55
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

  • Posts: 960
Re: How can i calculate the kbps & khz of a file?
« Reply #1 on: 4 Apr '03 - 02:58 »
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:
Code: [Select]
BitRate := Round(BASS_StreamGetFilePosition(strm, 2) * 8 / BASS_ChannelBytes2Seconds(strm, BASS_StreamGetLength(strm)) / 1000);