Author Topic: SYNCPROC never called  (Read 77 times)

christophermh44

  • Posts: 6
SYNCPROC never called
« on: 13 Aug '17 - 00:09 »
Hello everyone,

I put a SYNCPROC on a channel to get notified when the music reaches an arbitrary position. For example:

Music: [-0-----------------------------------320--330-] (seconds)
                                              ↑  Here is the point where I put my SYNCPROC


It works in a lot of cases, but for some files, some positions given to the function BASS_ChannelSetSync() make the SYNCPROC never called, and the function BASS_ChannelSetSync() does not return any error.

Is there something I missed from the documentation?

Many thanks for your answers :)

EDIT: It seems that 2724 bytes or less before the end (about 0.015 seconds before the end), the SYNCPROC is not triggered.
« Last Edit: 13 Aug '17 - 01:40 by christophermh44 »

Ian @ un4seen

  • Administrator
  • Posts: 20210
Re: SYNCPROC never called
« Reply #1 on: 14 Aug '17 - 17:56 »
If you are setting the sync close to the end and it is not getting triggered, it may be that the initial length estimate was incorrect, resulting in the sync position never being reached. What does BASS_ChannelGetPosition say at the end, and how does that compare to the sync position? If you're playing an MP3/2/1 file, try using the BASS_STREAM_PRESCAN flag in the BASS_StreamCreateFile call to have the length scanned. If you need to always receive a callback, I would suggest also setting a BASS_SYNC_END sync just in case the end is reached before the sync position.

Daniel2

  • Guest
Re: SYNCPROC never called
« Reply #2 on: 19 Aug '17 - 18:12 »
I think this can also happen if you are using bass_fx and put the sync on the bass_fx handle and not the original decode channel handle.