Author Topic: Get x float samples  (Read 199 times)

tongub

  • Posts: 109
Get x float samples
« on: 3 Nov '22 - 16:50 »
Hi,

i have a library which requests x float samples to handle it. How can i achive this?
I tried to create a Decoding Stream with the "BASS_SAMPLE_FLOAT" flag but when requesting BASS_DATA_AVAILABLE it returns 0.
It should also work with non decoding streams.

Ian @ un4seen

  • Administrator
  • Posts: 24792
Re: Get x float samples
« Reply #1 on: 7 Nov '22 - 12:31 »
The BASS_DATA_AVAILABLE option tells how much data is buffered for playback (or recording) but decoding channels don't have a buffer, so it doesn't apply to them. If you want to know how much data a file stream has left then you could subtract the current position (BASS_ChannelGetPosition) from the length (BASS_ChannelGetLength). But note that the length value may just be an estimate, so also be prepared for less/more data being available.