sync issues with BASS
category: code [glöplog]
Hey guys,
Maybe it's a setup problem, but when I start playing from the middle of the song (using GNU Rocket) I get a little time offset (around 150ms) between the music and the BASS_ChannelGetPosition api function.
Have anyone experienced something like that before?
Is there a bass settings that can help with it?
Thanks,
TLM
Maybe it's a setup problem, but when I start playing from the middle of the song (using GNU Rocket) I get a little time offset (around 150ms) between the music and the BASS_ChannelGetPosition api function.
Have anyone experienced something like that before?
Is there a bass settings that can help with it?
Thanks,
TLM
150ms is hardly "little". Either way, look into BASS_DEVICE_LATENCY.
that
and beware of rounding artifacts in your impl., it actually happens if you dont do it right
and beware of rounding artifacts in your impl., it actually happens if you dont do it right
no, doesn't help... :(
I'm actually using something very similar to the example that comes with GNU rocket
Are you double/triple buffered?
not the I know of
I think that "BASS_STREAM_PRESCAN" solved the problem, not sure yet...
Have you tried a different soundfile? Maybe it's not related to your code at all, but to keyframes in the tune?
If it's an MP3, prescan could explain the problem, yeah (kind of what mog pointed out) - you can't do precise MP3 seeking without the file being completely scanned.
What gargaj and superplek said... correctly rounding the row sent to gnu-rocket did it for me.
protip: Bass can also get you a sound-driver latency that I used for a while to get WRONG results... ... honestly not sure if it makes sense to correct for or not, but particularly laptops sometimes show quite a lot of latency.
BASS_INFO info;
BASS_GetInfo( &info );
// The average delay (rounded up to the nearest millisecond) for playback of HSTREAM/HMUSIC channels to start and be heard.
long latency = static_cast<long>( info.latency );
protip: Bass can also get you a sound-driver latency that I used for a while to get WRONG results... ... honestly not sure if it makes sense to correct for or not, but particularly laptops sometimes show quite a lot of latency.
BASS_INFO info;
BASS_GetInfo( &info );
// The average delay (rounded up to the nearest millisecond) for playback of HSTREAM/HMUSIC channels to start and be heard.
long latency = static_cast<long>( info.latency );
The only reason the rocket-example doesn't use BASS_STREAM_PRESCAN, is because it comes with an OGG-soundtrack rather than an MP3.
Ok, confirmed - things are working nice now.
kusma got it right: I was using mp3 without BASS_STREAM_PRESCAN.
Thanks everyone!
kusma got it right: I was using mp3 without BASS_STREAM_PRESCAN.
Thanks everyone!
oh sure
that damn norwegian bastard had to get it right
that damn norwegian bastard had to get it right