Re: Detecting if stream is finished playing
Chris Robinson <[email protected]>
| Newsgroups | gmane.comp.lib.openal |
|---|---|
| Message-ID | <[email protected]> |
On Saturday, August 07, 2010 6:53:50 am Nameless wrote:
> Hello, I came with one problem I can't get over, I tried Googling the
> stuff, but there's no useful answer. Thing is, I need to detect if source
> is finished playing. Messing around AL_SOURCE_STATE didn't help either. I
> need this, because I can free memory only after source is finished
> playing, and I need to do it every frame. So my question is, if there's
> some function/way how to detect it?
Hi.
The AL_SOURCE_STATE property should do what you want. Does something like this
not work?
bool SourceIsPlaying(ALuint source)
{
ALint state;
alGetSourcei(source, AL_SOURCE_STATE, &state);
assert(alGetError() == AL_NO_ERROR);
return (state == AL_PLAYING);
}
_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal