how to create a progress bar for bass audio?

Blitz3D Forums/Blitz3D Programming/how to create a progress bar for bass audio?

dman(Posted 2010) [#1]
how to create a meter(progress bar) that will show the elaps time for the audio?

the progress bar should count down to zero when the stream is at the end.

I tried to use this (BASS_ChannelBytes2Seconds(stream,length) mod 3600) / 60 which will give me the elaps minutes.

I'm drawing a rectangle that resembles a progress bar with the width of 615 about the screen size and using the elaps time, so it looks something like this (615 - time * elaps) the time is BASS_ChannelBytes2Seconds(stream,pos). How can I get it to count down accurately?


_PJ_(Posted 2010) [#2]
You need to know the Total Length (usually in Milliseconds) in order to calculate the ratio.

Then the pixel count for the progress is simply the ratio scaled by 615.

i.e

Song Duration = x milliseconds
Total Bar Length = 615 pixels
Elapsed Time = y milliseconds
Progress in Pixels=(y/x)*615

To have the bar decrease from 615 to 0, just use 615-result

_______________________



Incidentally, dman, I noticed in the gallery for the DJ Scratching thing you're working on, you have a visual display of a sound's waveform. Might I ask how you read that data? It's something I've been trying to do for a long time now...

Last edited 2010