Question about BASS_ChannelSetSync and reverse stream

Started by nadia,

nadia

Hello  ;D
I'm trying to implement a basic playback driven by a jogwheel and eventually by the mouse wheel; in order to play till a given position I'm using BASS_ChannelSetSync with "BASS_SYNC_POS | BASS_SYNC_ONETIME" flags and it works great when playing forward; it seems that the sync is not generated when playing a reversed stream created with bass_fx; am I missing something or is this feature not implemented for reversed streams? If this should be the case, is there any suggestion for achieving something similar?

Thanks and kind regards  ;D

nadia

Ian @ un4seen

BASS_SYNC_POS syncs should also work in reverse. If you aren't already using it, please try this latest build, which includes some sync tweaks:

    www.un4seen.com/stuff/bass_fx.zip

If your sync still isn't working, how far in advance are you setting it? Note that data is decoded for reversal in blocks determined by the BASS_FX_ReverseCreate "dec_block" parameter, and a sync won't be triggered if its position has already been decoded (until the position is reached again).

nadia

Hello,  ;D

unfortunately it doesn't seem to work as I would expect.
I'm currently creating the reverse stream in this way

DWORD dwFlags = BASS_STREAM_DECODE;
hStream = BASS_FX_ReverseCreate (hOriginalStream, 2, BASS_FX_FREESOURCE | dwFlags);

and setting the sync in the way below in order to be notified when 6 seconds are played in reverse where these 6 seconds are represented by qwOffsetBytes which are subtracted to the current position:

QWORD qwNewPosBytes = qwCurrPosBytes - qwOffsetBytes;
BASS_ChannelSetSync (hStream, BASS_SYNC_POS | BASS_SYNC_ONETIME, qwNewPosBytes, &EndFunc, NULL);

But, although the stream plays in reverse, the sync is never triggered.

May be some parameter is wrong or may be I'm not doing things correctly?

Thanks and Kind regards

nadia

Ian @ un4seen

That seems to be working here. Are you sure your "qwCurrPosBytes" value is correct? This is what I tried successfully:

QWORD qwCurrPosBytes = BASS_ChannelGetPosition(hStream, 0);
QWORD qwOffsetBytes = BASS_ChannelSeconds2Bytes(hStream, 6);
QWORD    qwNewPosBytes = qwCurrPosBytes - qwOffsetBytes;
BASS_ChannelSetSync (hStream, BASS_SYNC_POS | BASS_SYNC_ONETIME, qwNewPosBytes, &EndFunc, NULL);

nadia

Ops, :o
indeed the error was inside the new position, sorry for the trouble, it works just fine.

Thanks and kind regards  ;D

nadia

Ian @ un4seen

OK. Good to hear you found the problem, and it wasn't BASS or BASS_FX :D