Author Topic: Audio information + vb  (Read 2135 times)

Titeuf

  • Posts: 4
Audio information + vb
« on: 24 Mar '03 - 14:31 »
Hi :)

I use VB6, and I would like how to get the sample rate, the bit rate and the channel of the MP3,WMA and OGG files ?

If somebody have an example ! Thanks

Ian @ un4seen

  • Administrator
  • Posts: 22829
Re: Audio information + vb
« Reply #1 on: 25 Mar '03 - 15:14 »
I can't help with VB specifics, but you can use BASS_ChannelGetAttributes to get the sample rate and BASS_ChannelGetFlags to check for mono/stereo. The average bitrate can be calculated like this...
Code: [Select]
bitrate = BASS_StreamGetFilePosition(handle,BASS_FILEPOS_END)*8 / BASS_ChannelBytes2Seconds(handle,BASS_StreamGetLength(handle));