Hi yall
I feel dumb im just setting this up with a simple html5 site in typescript and when compiled it doesn’t like the global FMOD and says its not defined. Any ideas, also couldn’t find a code starter a link would be helpful.
I’ve included the error, the html and the ts, the error occurs on line 26 in the type script
You need to instantiate the FMOD
variable in your script. From the example JS files included in the download, you can see these at the top:
//==============================================================================
// Prerequisite code needed to set up FMOD object. See documentation.
//==============================================================================
var FMOD = {}; // FMOD global object which must be declared to enable 'main' and 'preRun' and then call the constructor function.
FMOD['preRun'] = prerun; // Will be called before FMOD runs, but after the Emscripten runtime has initialized
FMOD['onRuntimeInitialized'] = main; // Called when the Emscripten runtime has initialized
FMOD['INITIAL_MEMORY'] = 64*1024*1024; // FMOD Heap defaults to 16mb which is enough for this demo, but set it differently here for demonstration (64mb)
FMODModule(FMOD); // Calling the constructor function with our object
sure but the code generates that data into the variable fmod, im looking for the global enums
var fmod = {
TOTAL_MEMORY: 24 * 1024 * 1024,
preRun: preRun,
onRuntimeInitialized: main
};
is the same thing as above from what i can tell of the compiled js.
if i just past that into the js I get this
Uncaught TypeError: FMOD.STUDIO_INITFLAGS is undefined
Hi,
What version of the API are you currently using and are you able to get any of the HTML5 examples to run? The examples are found in fmodstudioapo(versionnumber)hmtl5->api->core->examples
. If you need help getting those up and running it can be found under Platform Specific Details | HTML5.