[Openal] AL_*_OFFSET
Jens Christian Restemeier
jens.restemeier at gmail.com
Sun Oct 1 05:41:22 PDT 2006
Hi,
I'm trying to synchronise graphical events with a streamed soundtrack.
The problem is, that a system timer runs out of sync after a while.
This is not specific to OpenAL, because I've seen that on other
platforms as well.
I want to use the AL_*_OFFSET functions, preferably AL_SEC_OFFSET, but
I run into two problems. First of all, I get crashes with this stack:
#0 0x9b74e5c8 in OALSource::FramesToSeconds
#1 0x9b74e578 in OALSource::FramesToSeconds
#2 0x9b7419bc in alGetSourcei
#3 0x00005378 in AudioStream::getStreamPosition at player_example.cpp:168
And second: the offset seems to be relative to the buffer that is
currently played, and not relative to when the source started playing.
I could of course modify my code to keep track of which buffers are
submitted and calculate the offset myself, but for streaming wouldn't
it make more sense in general to get the absolute offset?
A smaller problem is that the seconds offset seem to be rounded to
integer seconds, no matter if you request the value with alGetSourcei
or alGetSourcef: you always get whole seconds.
I'm using the OpenAL implementation on MacOS 10.4.8.
Are these known problems, and are there workarounds? On another
platform I was able to use timing events from the sounds engine to
calibrate my timers, and the theora example player for Linux keeps
track of which buffers are submitted to the kernel for callibration. I
could try something similar with OpenAL, but I'd prefer to use a
built-in feature.
Thanks,
Jens
P.S.: Is there a way to get a more modern OpenAL implementation to
work on MacOS 10.3 ?
More information about the Openal
mailing list