Bass.dll Record Buffer Setting?

BlitzPlus Forums/BlitzPlus Programming/Bass.dll Record Buffer Setting?

Arem(Posted 2008) [#1]
I want to use bass.dll to do spectrum analysis on anything currently playing on the system.

I've got everything working, but the problem is that bass.dll has a "default" recording buffer of 500ms. Thus my spectrum analysis is 500ms behind the actual audio.

Anybody know how to decrease the buffer length?


Abrexxes(Posted 2008) [#2]
500? the default buffer is 2000ms and can be changed from 1000 ms to 5000 ms

500 ms is the default of PLAYBACK buffers. (Bass_Config_Buffer)

BASS_SetConfig(BASS_CONFIG_REC_BUFFER,1000); change to 1000ms


More info in the bass.chm ->Options->Bass_Config_Rec_Buffer

bye


Arem(Posted 2008) [#3]
Thanks for the reply! I see that the help says that buffer size doesn't effect latency. So I'm still in the boat of having my visualization behind the audio, and it's the same distance behind no matter what buffer size I use.

I don't suppose there's a way to get rid of the latency...


Abrexxes(Posted 2008) [#4]
Have you tried the BASS_DATA_AVAILABLE flag of BASS_Channel_Get_Data? This returns in every mainloop the datas stored and dont wait that the record buffer is full. (See bass.chm)

Else..i dont now. Ask in the bass forum for this.


Arem(Posted 2008) [#5]
Thanks. I did some poking around. The problem was, there was quite a bit of data just sitting in the buffers. To fix the problem, I added a request at the end of my loop to pull a large amount of data out of the buffers. That way, the buffers get cleared, then get new data during the delay period.


Abrexxes(Posted 2008) [#6]
Yeah! There is a user searching for the problem. :) Thanks Arem for your "work" on bbs. :) (Bass is to hard that i can not research research every problem in some minutes, if you use it you will se this..)