OgreAL and Undo


06-03-2007 13:42:26

Hi all,
I would like to know if there is a simple way to save the position (the played time) of a song with [Open/Ogre]AL. in order to replay a sound at the position saved.

So maybe if it's not possible, there is a way to know the last chunk read in a SoundStream?



06-03-2007 13:58:03

I'm not sure if there's a seek function. I'm pretty sure there isn't one for streams, just by their nature, but there might (should?) be one for... not streams.

As far as saving a "checkpoint" if you will, That would be out of the scope of OgreAL, and up to you as the developer to implement, though if we were to implement a seek function (if it hasn't been done already), we would certainly write methods to allow you to get the position in the track, so you could simply save that and pass it into the seek method later on.

An interesting idea, probably useful, though likely not possible with streams.


06-03-2007 15:00:29

It is possible with streams actually. It would just need to do an ov_read() into the file and then refill the buffers. But you are absolutely correct, saving the position, both specially and chronologically, are out of the scope of OgreAL.


06-03-2007 16:12:51

OK, i don't say it should be OgreAL wich as to do that, just how i can do that...
And OgreAL provides everything i need or i have to change the API ?



06-03-2007 16:36:03

It doesn't have the get / setTime methods yet, so you would need to add that or wait until it is added (it's on the list) but the position is pretty easy, since the Sounds are MovableObjects all you need to do is ask for their derived position.