C# - Failing to load samples


I’m trying to wrap my head around the Studio API to eventually integrate it into my application.

I have successfuly played back a wave file using the Core API, along with some basic FFT analysis.

I’m now stuck at playing back FMOD Studio events. I am following the steps from the documentation:

  1. Init the Studio System > OK
  2. Load Bank (incl. strings) > OK
  3. Explicitly load samples > Forever in LOADING state, but can be skipped
  4. Lookup Event via path and create an instance from the EventDescription > OK
  5. Call Start on the instance > OK, but now the instance is forever stuck in the STARTING state as it fails to load the sample and never plays

Using system.flushSampleLoading() after sample load calls does not block (strange) and neither fixes anything.

The Studio project is compiled for Desktop and functions fully in Unity.

I’m using the *.cs wrappers and dlls included in the API installation.

Is there anything I’m missing in the setup process or anywhere else? Any help is much appreciated, thanks!

Here’s the test app source and build incl. the FMOD Studio project

Are you able to check the FMOD_RESULT returned from all the FMOD functions, it may shed some light on any issues.

Yes, I have wrapped every FMOD function with a check function that stops the program (and reports the output) unless the result is OK. And (unfortunately), all FMOD functions return with OK so the program runs fine - but never loads the samples.

static void emitStudioEventExample()
    var system = initStudioSystem();

    Console.WriteLine("Loading banks");

    FMOD.Studio.Bank bank;
    checkResult(system.loadBankFile("bank/Build/Desktop/Master.bank", FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out bank));
    FMOD.Studio.Bank stringsBank;
    checkResult(system.loadBankFile("bank/Build/Desktop/Master.strings.bank", FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out stringsBank)); // Must be loaded for Event paths to work


    Console.WriteLine("Loading sample data");

        checkResult(bank.getSampleLoadingState(out lState));
    while (lState != FMOD.Studio.LOADING_STATE.LOADED);


    FMOD.Studio.EventDescription[] evList;
    bank.getEventList(out evList);

    foreach (var evv in evList)
        string path;
        evv.getPath(out path);

        Guid guid;
        evv.getID(out guid);

    Console.WriteLine("Getting event");

    FMOD.Studio.EventDescription ev;
    checkResult(system.getEvent("event:/Event", out ev));


        // Gets stuck here with "LOADING"
        checkResult(ev.getSampleLoadingState(out lState));
    while (lState != FMOD.Studio.LOADING_STATE.LOADED);

    Console.WriteLine("Creating new event instance");

    FMOD.Studio.EventInstance instance;
    checkResult(ev.createInstance(out instance));

    while (true) {
        FMOD.Studio.PLAYBACK_STATE pState;
        instance.getPlaybackState(out pState);



It looks like you need to add system.update() to each of your while loops.

…calling Studio::System::update from your game is a fast operation which submits the queued command buffer to the asynchronous thread and performs any asynchronous callbacks due to processing on the Studio update thread.


Thank you very much @cameron-fmod !
Missing that call was indeed the issue.