Skip to content

Most efficient way to replay sounds? #317

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

You must be logged in to vote

If you're making a game engine, I've started recommending jumping in and using the engine stuff directly. It's starting to stabilize now, though there could still be some API changes here and there (no major changes or anything).

I can give you some basic details on what I do with the engine API. Basically for short sounds, I decode the file and store the decoded samples directly in memory. That memory buffer is then plugged into a ma_audio_buffer object which is significantly lighter weight than a ma_decoder. Do a search for "ma_audio_buffer;" in miniaudio.h to see it's API. You can use the ma_audio_buffer_*() functions directly for reading and seeking, or you can plug your ma_audio_buffer

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@willdieh
Comment options

@mackron
Comment options

@willdieh
Comment options

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