Is this even possible? Would be extra cool if somehow I manage to have a function called every time a buffer has been processed. Any other ideas besides polling the source it’s welcomed 😀
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You know how many samples are in each buffer and you know the sample rate that the source is playing at. That should give you a pretty good idea of when the source will finish processing a buffer.
If you’re feeling very intrepid, you could hack this into the OpenAL-soft source. By the looks of the code, you would put the change into
mixer.cat the very end of the file, somewhere near the end of theMixSource()function.Remembering, of course, that OpenAL-soft is lGPL; so you’d need to release/make available any changes that you made to the library itself.
If you’re stuck using pre-included libraries, then you don’t have many options. OpenAL rejects the idea of callback functions.