« Return to Thread: Switching buffers dynamically

Re: Switching buffers dynamically

by bpazolli :: Rate this Message:

Reply to Author | View in Thread


Jason Daly wrote:
alBufferData works fine for updating a buffer's data during execution.  
Most likely, your buffer is still assigned to a source while you're
trying to change it, which isn't permitted.  If you're statically
assigning the buffer to a source, remove it with alSourcei(sid,
AL_BUFFER, 0).  If you're using the buffer queue, unqueue the buffer
(using alUnqueueBuffers() ).

If that's not the problem, check the error code after the alBufferData
command (call alGetError before the alBufferData call to reset the error
state, then call it again after the alBufferData call to get the error
code).
That was the problem it all works now. Thanks all. I also had to alSourceStop before removing the buffer to get it to work.

Thank You All,
Ben Pazolli

 « Return to Thread: Switching buffers dynamically