Skip to content

Short Repeated Sounds Current Best Practice? #966

Answered by mackron
Cornfritter asked this question in Q&A
Discussion options

You must be logged in to vote

Yes this is the correct way to do it. The most important thing is using MA_SOUND_FLAG_DECODE and to initialize a ma_sound object at load time to keep it in memory, and then use ma_sound_init_copy() off that pre-loaded sound.

Also, can you clarify how to adjust the internal buffer size with this method?

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.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Cornfritter
Comment options

Answer selected by Cornfritter
Comment options

You must be logged in to vote
1 reply
@mackron
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants