Short Repeated Sounds Current Best Practice? #966
-
Thanks for the great project! After reading the docs and past discussion, and trying out some things, I'm wondering if this is the current recommended way to handle multiple repeated (overlapping) short sounds -- the method with the least latency. This is what I'm doing:
Is this right generally? I realize some details might depend on other factors. Also, can you clarify how to adjust the internal buffer size with this method? Thanks a lot! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Yes this is the correct way to do it. The most important thing is using
Not quite sure what you mean by this. Sounds don't have the notion of an internal buffer, except for streams which is not configurable. Do you perhaps mean the buffer that controls overall latency of the engine as a whole? |
Beta Was this translation helpful? Give feedback.
-
I tried to do this, but in ma_sound_init_copy there is this comment: And that's where my code fails now, because I load the data myself and set up the decoders myself. So what would be the steps to do this, if I don't use the resource manager? |
Beta Was this translation helpful? Give feedback.
Yes this is the correct way to do it. The most important thing is using
MA_SOUND_FLAG_DECODE
and to initialize ama_sound
object at load time to keep it in memory, and then usema_sound_init_copy()
off that pre-loaded sound.Not quite sure what you mean by this. Sounds don't have the notion of an internal buffer, except for streams which is not configurable. Do you perhaps mean the buffer that controls overall latency of the engine as a whole?
periodSizeInMilliseconds
in the engine config might help you there.