Author Topic: STREAMPROC buffer length  (Read 6547 times)

biggyspender

  • Posts: 28
STREAMPROC buffer length
« on: 20 Aug '03 - 10:13 »
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

  • Administrator
  • Posts: 25067
Re: STREAMPROC buffer length
« Reply #1 on: 21 Aug '03 - 15:12 »
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

  • Posts: 28
Re: STREAMPROC buffer length
« Reply #2 on: 21 Aug '03 - 15:56 »

Quote

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 :)


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

  • Administrator
  • Posts: 25067
Re: STREAMPROC buffer length
« Reply #3 on: 21 Aug '03 - 21:59 »
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.