STREAMPROC buffer length

Started by biggyspender, 20 Aug '03 - 10:13

biggyspender

I'm trying to optimise buffer usage/allocation in my STREAMPROC.

How do you calculate the maximum number of bytes that BASS will request from a STREAMPROC?

Ian @ un4seen

During playback, BASS will request at most 200ms worth of sample data from a STREAMPROC. Of course, with a decoding channel, the amount requested is what you specify in the BASS_ChannelGetData call :)

biggyspender


QuoteDuring playback, BASS will request at most 200ms worth of sample data from a STREAMPROC. Of course, with a decoding channel, the amount requested is what you specify in the BASS_ChannelGetData call :)

So if this is (for example) 16bit44100 stereo then the request would never exceed 2(bytes)*2(channels)*44100*0.2 or 35280 bytes, right?

Ian @ un4seen

Yes.

Note: that 200ms is based on the channel's current sample rate, so if you change the sample rate, the max amount requested will change accordingly.