Skip to content
Francisco Dias edited this page Feb 22, 2024 · 4 revisions

Bank

FMOD Object: Studio::Bank


This module holds the functionality for FMOD Studio banks, which contain the metadata and audio sample data required for runtime mixing and playback. Audio sample data may be packed into the same bank as the events which reference it, or it may be packed into separate banks.

Functions

This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.



Back To Top

fmod_studio_bank_get_loading_state

FMOD Function: Studio::Bank::getLoadingState


This function is used to check the loading state of a bank which has been loaded asynchronously using the FMOD_STUDIO_LOAD_BANK.NONBLOCKING flag, or is pending unload following a call to fmod_studio_bank_unload.

If an asynchronous load failed due to a file error, state will contain FMOD_STUDIO_LOADING_STATE.ERROR and the return code from the next fmod_last_result call will be the error code of the bank load function.


Syntax:

fmod_studio_bank_get_loading_state(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

FMOD_STUDIO_LOADING_STATE




Back To Top

fmod_studio_bank_load_sample_data

FMOD Function: Studio::Bank::loadSampleData


This function loads non-streaming sample data for all events in the bank.

Use this function to preload sample data ahead of time so that the events in the bank can play immediately when started.

This function is equivalent to calling fmod_studio_event_description_load_sample_data for all events in the bank, including referenced events.


Syntax:

fmod_studio_bank_load_sample_data(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

N/A




Back To Top

fmod_studio_bank_unload_sample_data

FMOD Function: Studio::Bank::unloadSampleData


This function unloads non-streaming sample data for all events in the bank.

Sample data loading is reference counted and the sample data will remain loaded until unload requests corresponding to all load requests are made, or until the bank is unloaded. For more details see Sample Data Loading.


Syntax:

fmod_studio_bank_unload_sample_data(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

N/A




Back To Top

fmod_studio_bank_get_sample_loading_state

FMOD Function: Studio::Bank::getSampleLoadingState


This function retrieves the loading state of the samples in the bank.

May be used for tracking the status of the fmod_studio_bank_load_sample_data operation.

If fmod_studio_bank_load_sample_data has not been called for the bank then this function will return FMOD_STUDIO_LOADING_STATE.UNLOADED even though sample data may have been loaded by other API calls.


Syntax:

fmod_studio_bank_get_sample_loading_state(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

FMOD_STUDIO_LOADING_STATE




Back To Top

fmod_studio_bank_unload

FMOD Function: Studio::Bank::unload


This function unloads the bank.

This will destroy all objects created from the bank, unload all sample data inside the bank, and invalidate all API handles referring to the bank.

If the bank was loaded from user-managed memory, e.g. by fmod_studio_system_load_bank_memory with the FMOD_STUDIO_LOAD_MEMORY_MODE.MEMORY_POINT mode, then the memory must not be freed until the unload has completed. Poll the loading state using fmod_studio_bank_get_loading_state or use the FMOD_STUDIO_SYSTEM_CALLBACK.BANK_UNLOAD system callback (see fmod_studio_system_set_callback) to determine when it is safe to free the memory.


Syntax:

fmod_studio_bank_unload(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

N/A




Back To Top

fmod_studio_bank_get_bus_count

FMOD Function: Studio::Bank::getBusCount


This function retrieves the number of buses in the bank.

May be used in conjunction with fmod_studio_bank_get_bus_list to enumerate the buses in the bank.


Syntax:

fmod_studio_bank_get_bus_count(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

Real




Back To Top

fmod_studio_bank_get_bus_list

FMOD Function: Studio::Bank::getBusList


This function retrieves an array containing the buses in the bank.

May be used in conjunction with fmod_studio_bank_get_bus_count to enumerate the buses in the bank.


Syntax:

fmod_studio_bank_get_bus_list(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

Array of Real




Back To Top

fmod_studio_bank_get_event_count

FMOD Function: Studio::Bank::getEventCount


This function retrieves the number of event descriptions in the bank.

May be used in conjunction with fmod_studio_bank_get_event_description_list to enumerate the events in the bank.

This function counts the events which were added to the bank by the sound designer. The bank may contain additional events which are referenced by event instruments but were not added to the bank, and those referenced events are not counted.


Syntax:

fmod_studio_bank_get_event_count(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

Real




Back To Top

fmod_studio_bank_get_event_description_list

FMOD Function: Studio::Bank::getEventList


This function retrieves an array containing the event descriptions in the bank.

May be used in conjunction with fmod_studio_bank_get_event_count to enumerate the events in the bank.

This function retrieves the events which were added to the bank by the sound designer. The bank may contain additional events which are referenced by event instruments but were not added to the bank, and those referenced events are not retrieved.


Syntax:

fmod_studio_bank_get_event_description_list(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

Array of Real




Back To Top

fmod_studio_bank_get_string_count

FMOD Function: Studio::Bank::getStringCount


This function retrieves the number of string table entries in the bank.

May be used in conjunction with fmod_studio_bank_get_string_info to enumerate the string table in a bank.


Syntax:

fmod_studio_bank_get_string_count(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

Real




Back To Top

fmod_studio_bank_get_string_info

FMOD Function: Studio::Bank::getStringInfo


This function retrieves a string table entry.

May be used in conjunction with fmod_studio_bank_get_string_count to enumerate the string table in a bank.


Syntax:

fmod_studio_bank_get_string_info(bank_ref, string_index)
Argument Type Description
bank_ref Real A reference to a bank.
string_index Real String table entry index.

Returns:

FmodStudioStringInfo




Back To Top

fmod_studio_bank_get_vca_count

FMOD Function: Studio::Bank::getVCACount


This function retrieves the number of VCAs in the bank.

May be used in conjunction with fmod_studio_bank_get_vca_list to enumerate the VCAs in a bank.


Syntax:

fmod_studio_bank_get_vca_count(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

Real




Back To Top

fmod_studio_bank_get_vca_list

FMOD Function: Studio::Bank::getVCAList


This function retrieves an array containing the VCAs in the bank.

May be used in conjunction with fmod_studio_bank_get_vca_count to enumerate the VCAs in a bank.


Syntax:

fmod_studio_bank_get_vca_list(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

Array of Real




Back To Top

fmod_studio_bank_get_id

FMOD Function: Studio::Bank::getID


This function retrieves the GUID of the given bank.


Syntax:

fmod_studio_bank_get_id(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

String




Back To Top

fmod_studio_bank_get_path

FMOD Function: Studio::Bank::getPath


This function retrieves the path of the given bank.

The strings bank must be loaded prior to calling this function, otherwise FMOD_RESULT.ERR_EVENT_NOTFOUND is returned in the next fmod_last_result call.


Syntax:

fmod_studio_bank_get_path(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

String




Back To Top

fmod_studio_bank_is_valid

FMOD Function: Studio::Bank::isValid


This function checks whether the given Bank reference is valid, returning true or false.


Syntax:

fmod_studio_bank_is_valid(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

Boolean




Back To Top

fmod_studio_bank_set_user_data

FMOD Function: Studio::Bank::setUserData


This function allows a real value to be attached to this object. See User Data for an example of how to get and set user data.


Syntax:

fmod_studio_bank_set_user_data(bank_ref, data)
Argument Type Description
bank_ref Real A reference to a bank.
data Real The real value to attach.

Returns:

N/A




Back To Top

fmod_studio_bank_get_user_data

FMOD Function: Studio::Bank::getUserData


This function allows arbitrary user data to be retrieved from this object. See User Data for an example of how to get and set user data.

The function returns NaN if there is no user data attached to the bank.


Syntax:

fmod_studio_bank_get_user_data(bank_ref)
Argument Type Description
bank_ref Real A reference to a bank.

Returns:

Real



Clone this wiki locally