19 Jun '13 - 19:05 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Pulling out Information from files  (Read 324 times)
hexsharp
Posts: 4


« on: 4 Aug '12 - 21:31 »
Reply with quoteQuote

Ok... i guess i wasn't exactly able to understand the bass.net help file but...

i know how to play files and stuff but... i really didn't understand how to get details like duration, bitrate etc from a file/stream ... the whole INFO_TAG thing?... ... =( ....
Logged
Ian @ un4seen
Administrator
Posts: 15366


« Reply #1 on: 6 Aug '12 - 13:07 »
Reply with quoteQuote

The duration is available from BASS_ChannelGetLength, like this...

QWORD length=BASS_ChannelGetLength(handle, BASS_POS_BYTE); // get length in bytes
double secs=BASS_ChannelBytes2Seconds(handle, length); // translate that to seconds

The average bitrate can be calculated by dividing the file size by the duration, like this...

QWORD filesize=BASS_StreamGetFilePosition(handle, BASS_FILEPOS_END); // get file size
double bitrate=filesize*8/secs; // calculate average bitrate (bps)

Also see BASS_ChannelGetInfo and BASS_ChannelGetTags for other information that's available.
Logged
hexsharp
Posts: 4


« Reply #2 on: 9 Aug '12 - 07:11 »
Reply with quoteQuote

oh thanks so much!...

and for others who much be looking for more vb.net help...
http://www.un4seen.com/forum/?topic=13791.0
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines