Replies: 1 comment 2 replies
-
Unfortunately you're out of luck with this one. The most practical way would be custom allocation callbacks, but like you alluded to, that's quite generic and it won't give you intelligence as to what specifically is being allocated. But to optimize your allocations as much as possible, a custom allocator is the best option I can think of. I have some distant plans to change the high level API to make |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am trying to implement an API for a game roughly like this using miniaudio:
where
sound_source_load
would front-load all IO/decoding andsound_play
should play a sound without doing any allocations. I really want to avoid doing memory allocations in the game's main loop.I am not sure how to do this best. It seems to me that every version of ma_sound_init will allocate at least in
ma_engine_node_init
(pHeap). And it also seems like you cannot change the data source of an existing sound, once it has been initialized, so the only options I see are:What way would you recommend to implement an API like this or more generally use miniaudio to play sounds without allocating in the main loop? Is there a way to provide the additional heap memory needed by a sound node from the outside and somehow query the needed memory beforehand?
Beta Was this translation helpful? Give feedback.
All reactions