Author Topic: Tempo Create + Set Position = Buffer Delay  (Read 38 times)

Blink123123

  • Posts: 11
Hello,

I am trying to implement a sync algorithm using Bass Net.
I am using Bass Mixer with BASS_Mixer_StreamAddChannelEx to set the song in sync.
When both songs have the same BPM its all fine, however if i change the tempo using BASS_FX_TempoCreate there would be a small delay.

I tried all of these solutions with not so perfect solutions:
 - Set custom buffer size and etc...: prefer not to use it since the sync would be the only real-time requirement for my testing purposes, I want to achieve it in low latency mode if it is possible
 - Pause mixer, then resume with clear buffer flag: introduced some sound skipping.
 - Setting BASS_ATTRIB_MIXER_LATENCY to 0.001f: felt an improvement but not getting a good ifnal result.
 - Use the mp3 stream instead of the tempo stream: introduced errors, didn't investigate all the way but didn't feel like a clean solution.

My current solution is using a get position in real-time to find the small difference and using set position in a loop while accounting to the delays introduced to finally reach a sync state after multiple tries.

I am not an expert in coding but the solution should be easy, am I missing something?