# FMOD WebGL Loading Banks

**URL:** <https://qa.fmod.com/t/fmod-webgl-loading-banks/15777>\
**Category:** Unity\
**Created:** [May 17, 2020, 6:58pm UTC](https://qa.fmod.com/t/fmod-webgl-loading-banks/15777 "2020-05-17T18:58:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathcong](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@mathcong](https://qa.fmod.com/u/mathcong)\
**Post date:** [May 17, 2020, 6:58pm UTC](https://qa.fmod.com/t/fmod-webgl-loading-banks/15777/1 "2020-05-17T18:58:04Z")

</div>

I am making a webgl game and loading in the master bank(my only bank) takes a while (its 5mb).

Is there a way to load in the master bank before my game starts?

If i wanted to have audio for my opening screen, it would likely give an error: bank not loaded yet.

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [May 22, 2020, 1:53am UTC](https://qa.fmod.com/t/fmod-webgl-loading-banks/15777/2 "2020-05-22T01:53:51Z")

</div>

It might be preferable in this situation to have the master bank empty and to have separate banks for different tasks (eg. main menu, game, etc.). That way you can quickly load smaller master bank plus the bank you need for the start of the game.

It’s interesting you are getting bank not loaded yet, as `Studio::System::loadBankFile()` is blocking by default. Could you post some code on how you’re loading the master bank?

---

<div class="post-metadata">

**Author:** ![chughes42](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@chughes42](https://qa.fmod.com/u/chughes42)\
**Post date:** [May 31, 2020, 3:53pm UTC](https://qa.fmod.com/t/fmod-webgl-loading-banks/15777/3 "2020-05-31T15:53:52Z")

</div>

Hi,

I normally have a menu scene and use the StartGame() method called from a button to load the main game scene with the following script on a gameobject. If the menu screen has music or sounds then i would place a blank scene before the menu scene and have similar code a transition to the menu scene. This code loops until the bank has loaded.

using System.Collections;  
using System.Collections.Generic;  
using UnityEngine;  
using UnityEngine.SceneManagement;

public class Actions : MonoBehaviour  
{  
public void StartGame()  
{

```
    FMODUnity.RuntimeManager.LoadBank("Master");
   
    StartCoroutine(ChangeScene(1));
}

IEnumerator ChangeScene(int buildID)
{
    yield return new WaitForSeconds(1);

    if (FMODUnity.RuntimeManager.HasBankLoaded("Master"))
    {
        SceneManager.LoadScene(buildID);

    }
    else
    {
        Debug.Log("Master bank not loaded looping");
        StartCoroutine(ChangeScene(buildID));
    }

}

```

}

There is some documentation @ [https://fmod.com/resources/documentation-unity?version=2.0&page=platform-specifics.html#html5webgl](https://fmod.com/resources/documentation-unity?version=2.0&page=platform-specifics.html#html5webgl)

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [June 2, 2020, 2:10am UTC](https://qa.fmod.com/t/fmod-webgl-loading-banks/15777/4 "2020-06-02T02:10:45Z")

</div>

I see. In that case, it seems like everything is working as expected, but if you wanted the game to load faster it would be best to create multiple smaller banks for dedicated purposes and keep the master bank empty. This way you can have the main menu or beginning of the game load up quickly, without needing to wait for the entire audio solution to load (such as late game assets).
