When using FMOD_STUDIO_LOAD_MEMORY_POINT, the buffer needs to be 32-bit aligned. Which would explain why you don’t get this error every time.
Make sure to keep the buffer around, you can only free it after receiving a FMOD_STUDIO_SYSTEM_CALLBACK_BANK_UNLOAD callback, otherwise use FMOD_STUDIO_LOAD_MEMORY to create a copy.
If you look at my original code sample, you’ll see that it actually is aligned correctly (it’s 32 bytes btw, not bits, but it uses a define anyway)
And yes, I am keeping it in memory
Can you try with the logging libs, they should provide more information on the cause.
Looks like FMOD seem to think that the data isn’t 32 byte aligned
[ERR] AsyncCommandTableShadow::system_loadBankMemory : Error! FMOD_STUDIO_LOAD_MEMORY_POINT buffer is not 32-byte aligned!
However, I’m pretty sure that 800 bytes are aligned to 32 bytes?
I logged my variables just to be sure:
BANK SIZE: 800, WAS 774, PADDED WITH 26
This only happens for this bank as well. The other banks are much larger and always loads correctly:
BANK SIZE: 12480, WAS 12474, PADDED WITH 6
BANK SIZE: 5663456, WAS 5663456, PADDED WITH 0
Or wait, should the actual memory address be aligned to 32 even bytes? Not just the actual size.. ?
Yup, that seemed to have been the case. My bad! And thank you for the support Cameron, very appreciated!
- You must login to post comments
Please login first to submit.