ReadFile

FMOD Studio API

Firelight Technologies FMOD Studio API

ReadFile

Read the entire contents of a file into memory, as a JS variable that contains nothing but a memory address.

JavaScript Syntax

FMOD.ReadFile(
  system,             // FMOD::System object handle
  filename,           // (string) Filename of the file that is to be loaded, that has the path and filename that matches the preloaded path/filename if loaded in that fashion.
  output,             // The variable with the allocated memory containing the contents of the file.
);

Return Values

If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.

Remarks

The filename can be used to load a file that has been preloaded with FMOD.FS_createPreloadedFile
Note! The memory for the file is allocated internally in FMOD from the JS heap, so needs to be freed with FMOD.Memory_Free when not needed any more.




Version 1.10.03 Built on Feb 1, 2018