[Openal] playing a raw buffer

Chris Robinson chris.kcat at gmail.com
Thu Apr 23 19:04:36 PDT 2009


On Thursday 23 April 2009 6:14:31 am gmail wrote:
> Hello Chris and all,
>
> thanks for the help, anyway i am still  stucked on this problem.
> It really seems it is a kind of AL problem, even if probably it will not :)
>
> The entire code is quite great, so i try to pseudo-explain better the
> problem:
>
> I have a gui app, then a thread, with his own source/albuffers, that
> receive data from the network and play the data.
> Then, occasionally, my application can pop up a file-manager dialog, and
> play, through another thread with another alsource, a recorded file with
> raw data.

It's difficult to say without seeing any code that can reproduce the problem.

If you have a freshly generated source and buffer, and the buffer is properly 
filled with all the data, it should all play from beginning to end. If you 
don't use a fresh source, or if the buffer didn't fill with the start of the 
data, that possibly could cause the symptoms you describe, but I can't say for 
sure without seeing what the code does. You can try calling alSourcef(source, 
AL_SEC_OFFSET, 0.0f); right before alSourcePlay, and make sure the file handle 
starts from the beginning of the file when you read into the buffer, but I'm 
just guessing at the problem..


More information about the Openal mailing list