Hi. I want to run examples from Javascript API in node.js, adapting them (the js examples) to run standalone in node.js without html, but I´m having errors when loading fmodstudio.js library using ‘require’.
I have in my script the standar setup for javascript as defined in documentation :
var FMOD = {}; // FMOD global object
FMOD[‘preRun’] = prerun;
FMOD[‘onRuntimeInitialized’] = main;
FMOD[‘TOTAL_MEMORY’] = 6410241024;
FMODModule(FMOD); // Calling the constructor function with our object
And I´m trying to load fmodstudio.js library with ‘require’ this way, but it doesn´t work:
var fmodstudiojs = require(’./fmodstudio.js’);
Any suggestions please in how to load it in my .js and acces it?
ReferenceError: document is not defined
at prerun (D:\LMS_PROJ\NODE\FMOD\api\studio\examples\simple_event.js:87:9)
at callRuntimeCallbacks (D:\LMS_PROJ\NODE\FMOD\api\studio\examples\fmodstudio1.js:430:64)
at preRun (D:\LMS_PROJ\NODE\FMOD\api\studio\examples\fmodstudio1.js:444:71)
at run (D:\LMS_PROJ\NODE\FMOD\api\studio\examples\fmodstudio1.js:2195:2041)
at Object.FMODModule (D:\LMS_PROJ\NODE\FMOD\api\studio\examples\fmodstudio1.js:2195:3772)
at Object. (D:\LMS_PROJ\NODE\FMOD\api\studio\examples\simple_event.js:33:15)
at Module._compile (module.js:643:30)
at Object.Module._extensions…js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)