Recording multiple audio in a session messes up my COM, am I doing something wrong? #502
-
I have used miniaudio to handle/insert & play audio in my application. Recording itself works fine, but don't know how to fix the COM corruption issue. Any leads would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I don't have an exact answer for you. But I can see you've initialized an engine with miniaudio will initialize and uninitialize COM in two places - one is whenever a #define MA_COINIT_VALUE 0 // <-- Set this to your desired value.
#define MINIAUDIO_IMPLEMENTATION
#include <miniaudio.h> |
Beta Was this translation helpful? Give feedback.
I don't have an exact answer for you. But I can see you've initialized an engine with
ma_engine_init()
, but I can't see anma_engine_uninit()
. Maybe look at that?miniaudio will initialize and uninitialize COM in two places - one is whenever a
ma_context
is initialized and uninitialized and the other is in the worker thread. You can see them inma_worker_thread()
andma_context_init_backend_apis__win32()
/ma_context_uninit_backend_apis__win32()
. There's no bugs with the way miniaudio is doing it from what I can tell. If you need to customize the value that's passed intoCoInitializeEx()
you can do so by overridingMA_COINIT_VALUE
: