[Openal] Detaching buffers
koalabear33 at yahoo.com
Wed Sep 24 18:25:20 PDT 2003
I'm a newbie to OpenAL too so I don't know if you
should take advice from me but anyway, here are my
> Does that mean you can detach a buffer with:
> alSourcei( _src_id, AL_BUFFER, 0 );
> If not, how do you detach a buffer from a source?
What are you trying to do by detaching the buffer? Are
you just trying to switch the buffer to another one?
Or are you trying to detach before exiting or
something? I don't really understand what you are
trying to do.
Anyway, I could be wrong (someone correct me) but I
think you just switch the buffer to another one as you
want. I don't think you have to do anything:
//original buffer = oldBuffer
//when you want to change it (another part of code)
//new buffer = newBuffer
I think that's all you have to do to switch it to
another one. Of course, you need to remove the
oldBuffer from memory if you are not using it.
Do note that if you are trying to switch buffers in
order to play music (ie. trying to stream music), you
should not attach the buffer but QUEUE the buffers.
Queuing music will be more complicated but you should
use alSourceQueueBuffers() function.
Lastly, if you just want to close/exit, I don't think
you need to detach anything (I could be wrong of
course). Simply do something like (fill with
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
More information about the Openal