Hello,
I am trying to lock a sound to use the data in some other code (JavaScript/WASM, HTML5 build of FMOD), but the Sound.lock()
function always returns 31 (ERR_INVALID_PARAM). How do I use this function properly? The documentation does not provide any sort of example or special conditions, so I’m just integrating it as I would any other FMOD function. I have confirmed that using system.playSound()
works fine, however. This is my code:
// ...
let ptr1 = {};
let ptr2 = {};
let len1 = {};
let len2 = {};
if ((res = sound.lock(0, 128, ptr1, ptr2, len1, len2)) !== 0) { // lock to read 128 bytes (0-128)
console.error('Could not lock sound for reading', res);
}
// ...