Sound Queue in FMOD

Hello, I’m trying to translate my voice chat app from Windows Multimedia System (mmsystem) to FMOD and having trouble. So let’s talk only about sound output right now. I have 3 buffers for audio output. Every buffer contains audio data in PCM16 which longs 46 ms. In mmsystem I can just add buffers to queue and they will play in order. In between of these buffers will not be any “holes” and they will literally be stitched. I can’t find any queue in FMOD. Is there a way to create a queue in FMOD? And I don’t really know how to use callbacks (like pcmreadcallback for example) in classes because FMOD_CREATESOUNDEXINFO needs a link to function but not object.

P.S. And I think callbacks will still have “holes” in sound which will be audible.

it sounds like what you will want to do is use something like our “user_created_sound” example, in particular a user created stream. You can then fill the callbacks as they come in.

You can find this in the Core API examples in the API download.

Callbacks won’t make “holes” in the sound, it is just a way of filling a buffer that FMOD will process.

Ok but as I said: “I don’t know how to use callbacks (like pcmreadcallback for example) in classes because FMOD_CREATESOUNDEXINFO needs a link to function but not object”. Every user in my voice chat has an object of my class and so I need to pass a pointer to a function in class to pcmreadcallback, how do I do that?

1 Like

Looking over the examples may help you understand how the callbacks work. Rather than linking to an object, you would just link to a function in the object.

Yes, but to link to a function in the object I need the object. Because you can’t just link to a function in class without passing an object.

I don’t understand something?