Studio::System::loadBankMemory

FMOD Studio API

Firelight Technologies FMOD Studio API

Studio::System::loadBankMemory

Loads a Studio event bank from memory.

C++ Syntax

FMOD_RESULT Studio::System::loadBankMemory(
  const char *buffer,
  int length,
  FMOD_STUDIO_LOAD_MEMORY_MODE mode,
  FMOD_STUDIO_LOAD_BANK_FLAGS flags,
  Studio::Bank **bank
);

C Syntax

FMOD_RESULT FMOD_Studio_System_LoadBankMemory(
  FMOD_STUDIO_SYSTEM *system,
  const char *buffer,
  int length,
  FMOD_STUDIO_LOAD_MEMORY_MODE mode,
  FMOD_STUDIO_LOAD_BANK_FLAGS flags,
  FMOD_STUDIO_BANK **bank
);

C# Syntax

RESULT Studio.System.loadBankMemory(
  byte[] buffer,
  LOAD_BANK_FLAGS flags,
  out Bank bank
);

JavaScript Syntax

System.loadBankMemory(
  buffer,                          
  length,                          
  mode,                            
  flags,                           
  bank                             // writes value to bank.val
);

Parameters

buffer
Memory buffer to load from. This should be 32-byte aligned if mode is FMOD_STUDIO_LOAD_MEMORY_POINT.
length
Length of the memory buffer.
mode
Loading mode to use.
flags
Flags to control bank loading.
bank
Address of a variable to receive the Bank object. Optional. Specify 0 or NULL to ignore.

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

Specifying mode FMOD_STUDIO_LOAD_MEMORY_POINT will POINT to your memory rather than FMOD allocating its own buffers and duplicating it internally. When using this mode, the buffer must be aligned to FMOD_STUDIO_LOAD_MEMORY_ALIGNMENT and the lifetime of the memory must persist until the bank has been queued for unload and then the unload has been performed. You can ensure the memory is not being freed prematurely by only freeing it after receiving the FMOD_STUDIO_SYSTEM_CALLBACK_BANK_UNLOAD callback.

By default this function will block until the file load finishes, and then return the FMOD_RESULT indicating the result. If there was a file error for blocking bank loads, then the bank variable will be returned as NULL.

Using the FMOD_STUDIO_LOAD_BANK_NONBLOCKING flag will cause the bank to be loaded asynchronously. In that case it will always return FMOD_OK and a valid bank handle. File errors for asynchronous banks can be detected by calling Studio::Bank::getLoadingState. Failed asynchronous banks should be released by calling Studio::Bank::unload.

See Also




Version 1.10.03 Built on Feb 1, 2018