GUIDs.txt FMOD & Unity

Hello! I have 3 questions about FMOD Studio & Unity.

  1. In FMOD Studio, I can export a file GUIDs.txt. Can I export/get a file with a similar structure from the Unity project to which the .bank/.fspro file was previously uploaded.

  2. Is there any way I can import GUIDs.txt back to the project .fspro? For example, I need to change some GUIDs.

  3. Can I change GUIDs in FMOD?

To your first point, what exactly you mean by “get a file with a similar structure from the Unity project to which the .bank/.fspro file was previously uploaded”? What information specifically do you need from your banks/project?

As for GUIDs, there’s no way to import a GUIDs.txt back into a project, and the ability to export GUIDs is intended as a way to help manage running your FMOD Studio project in engine. GUIDs are assigned to each object in your FMOD Studio project as a way to uniquely identify them - while it should technically be possible to modify them if you modify an object’s GUID and every reference to its GUID in the project metadata, you shouldn’t need to. Can I get you to elaborate on why you need to change a GUID?

I mean, I can upload to Unity .bank files or .fspro file, and this is not surprising. I can export GUIDs.txt from my project .fspro, and this is also not surprising. But can I export such a file or something from Unity? I mean, I can upload to Unity .bank files. Can I export a GUIDs.txt file from these .bank files using Unity?

Thanks for clarifying what you meant.

Yes, it would be possible to export a similar GUIDs.txt file from Unity, provided you have banks. This would involve loading the banks into an FMOD System, and using the API to enumerate all elements of the project that have GUIDs that you wish to export - e.g. events, buses, VCAs, snapshots, and banks.

However, this functionality isn’t present as a part of the FMOD for Unity plugin, so it will need to be implemented in your own code.

1 Like

Thanks! Unfortunately, I’m not very good at writing scripts for Unity. I’ve been familiar with FMOD Studio for a long time, but not with Unity. Could you help me with writing such a script in C#, please?

I’ll look in documentation if it possible to retrieve GIUDs from bank but i have seen code of it somewhere on github. or Just ask ChatGPT for such script.
For 2 and 3 question:
There on github project that can change GUIDs of Bank file.
Github
1.You have to done all your work with Fmod Studio then build .Bank file
2. Download guid_replacer.exe from Github and place it in any place on pc. for convenience would be good to place it in Local disc D or C for example.
3.Put .bank file next to it.
4.Then run cmd or press Win + R combination to open it
5. Choose directories where you putted guid_replacer.exe , in my case command would be cd C:\Users\user\Desktop
6.write guid_replacer.exe >>>your_audio.bank<<< press enter and you’ll see all GUIDs of bank.
7.Next by using different command mentioned on github ,change GUID one by one , or multiple at once.

Usage:

List all event GUIDs:
guid_replacer.exe your_audio.bank

Replace GUIDs:
guid_replacer.exe your_audio.bank [GUID to replace] [what to replace it with]

Example:

guid_replacer.exe your_audio.bank {bc5e80f9-a380-47c9-8799-3e02eea94feb} {aabbccdd-eeff-00ff-aabb-feffefbbaacc}

Multiple replacements can be chained like this:

guid_replacer.exe your_audio.bank {GUID_A1} {GUID_A2} {GUID_B1} {GUID_B2}

1 Like

This is a useful thing, but unfortunately, I think he needs not only event guides, but also buses and banks.

try this , i’m not sure .this is “fast test” code


using System.IO;
using UnityEngine;

public class i : MonoBehaviour
{
    private FMOD.System coreSystem;
    private FMOD.RESULT result3;
    private FMOD.RESULT result4;
    private FMOD.GUID gge;
    private string ggew;

    // Start is called before the first frame update
    void Start()
    {
        FMOD.RESULT result = FMODUnity.RuntimeManager.StudioSystem.getBankCount(out int bankCount);
        FMOD.RESULT result2 = FMODUnity.RuntimeManager.StudioSystem.getBankCount(out int bankCount1);
        FMOD.RESULT result3 = FMODUnity.RuntimeManager.StudioSystem.getBankCount(out int bankCount2);
        FMOD.RESULT result4 = FMODUnity.RuntimeManager.StudioSystem.getBankCount(out int bankCount3);
        if (result != FMOD.RESULT.OK)
        {
            Debug.Log(result.ToString());
            return;
        }

        FMOD.Studio.Bank[] Banks = new FMOD.Studio.Bank[bankCount];

        FMODUnity.RuntimeManager.StudioSystem.getBankList(out Banks);

        for (int i = 0; i < bankCount; i++)
        {
            Banks[i].getEventCount(out int eventCount);
            FMOD.Studio.EventDescription[] decs = new FMOD.Studio.EventDescription[eventCount];
            FMOD.Studio.Bus[] decs2 = new FMOD.Studio.Bus[eventCount];
            FMOD.Studio.EventInstance[] decs3 = new FMOD.Studio.EventInstance[eventCount];
            FMOD.GUID gg = new FMOD.GUID();
            Banks[i].getPath(out string path2);

            if (eventCount > 0)
            {
                result = Banks[i].getEventList(out decs);
                result2 = Banks[i].getBusList(out decs2);
                Banks[i].getID(out gg);
                
                if (gg != null){

                    Debug.Log(gg +" ____ " + path2);
                }
                if (result != FMOD.RESULT.OK)
                {
                    Debug.Log(result.ToString());
                    return;
                }
                for (int y = 0; y < eventCount; y++)
                {
                    result = decs[y].getID(out FMOD.GUID id);
                    decs[y].getPath(out string path);

                    if (result != FMOD.RESULT.OK)
                    {
                        Debug.Log(result.ToString());
                        return;
                    }
                   
                    if (path != null)
                    {
                        Debug.Log(id  + " ____ " + path);
                    }
                    else { Debug.Log(id.ToString()); }
                    
                }
                for (int y = 0; y < decs2.Length; y++)
                {
                    decs2[y].getID(out gge);
                    decs2[y].getPath(out ggew);
                    if (gge != null && ggew != null)
                    {
                        Debug.Log(gge+ " ____ " + ggew);

                    }
                }
            }
            else
            {
                Banks[i].getPath(out string path);
                Debug.Log($"No events in bank: {path}");
            }
        }
    }
}


Writing an full script falls outside the scope of support unfortunately, but I can definitely give you some pointers. There’s a couple of way to do it, but the simplest is done by getting the GUID and path info from the strings bank - you’ll essentially want to do the following:

  • Make sure all of your banks are loaded, including the strings bank

  • Retrieve a reference to the strings bank either by:

    • Storing a reference when loading it
    • Using FMODUnity.RuntimeManager.StudioSystem.getBankList() and finding the strings bank in the list
    • Getting it from the system with one of the getBank methods like Studio.System.getBankByID() - i.e. FMODUnity.RuntimeManager.StudioSystem.getBankByID(yourIDHere, out FMOD.Studio.Bank bank)
  • Use Studio.Bank.getStringCount() on the strings bank to get the total number of string entries - i.e. bank.getStringCount(out int count)

  • Use Studio.Bank.getStringInfo() and the total number of string entries you just got to iterate over all string entries and get the path and GUIDs of each one - i.e.

for (int i = 0; i < count; i++)
{
    bank.getStringInfo(i, out GUID id, out string path);
}
  • Write the retrieved path and id to file as desired

Wow, it looks like this is exactly what I need. Thanks!

However, the GUIDs of VCA are not found

Here is with VCA, didn’t know about it. and ,read log with attention, there all mess.
and in your place ,i would better follow Louis_FMOD’s instructions.


using System.IO;
using UnityEngine;

public class i : MonoBehaviour
{
    private FMOD.System coreSystem;
    private FMOD.RESULT result3;
    private FMOD.RESULT result4;
    private FMOD.GUID gge;
    private string ggew;

    // Start is called before the first frame update
    void Start()
    {
        FMOD.RESULT result = FMODUnity.RuntimeManager.StudioSystem.getBankCount(out int bankCount);
        FMOD.RESULT result2 = FMODUnity.RuntimeManager.StudioSystem.getBankCount(out int bankCount1);
        FMOD.RESULT result3 = FMODUnity.RuntimeManager.StudioSystem.getBankCount(out int bankCount2);
        FMOD.RESULT result4 = FMODUnity.RuntimeManager.StudioSystem.getBankCount(out int bankCount3);
        if (result != FMOD.RESULT.OK)
        {
            Debug.Log(result.ToString());
            return;
        }

        FMOD.Studio.Bank[] Banks = new FMOD.Studio.Bank[bankCount];

        FMODUnity.RuntimeManager.StudioSystem.getBankList(out Banks);

        for (int i = 0; i < bankCount; i++)
        {
            Banks[i].getEventCount(out int eventCount);
            FMOD.Studio.EventDescription[] decs = new FMOD.Studio.EventDescription[eventCount];
            FMOD.Studio.Bus[] decs2 = new FMOD.Studio.Bus[eventCount];
            FMOD.Studio.VCA[] decs3 = new FMOD.Studio.VCA[eventCount];
            FMOD.GUID gg = new FMOD.GUID();
            Banks[i].getPath(out string path2);

            if (eventCount > 0)
            {
                result = Banks[i].getEventList(out decs);
                result2 = Banks[i].getBusList(out decs2);
                result3 = Banks[i].getVCAList(out decs3);
                Banks[i].getID(out gg);
                
                if (gg != null){

                    Debug.Log(gg +" ____ " + path2);
                }
                if (result != FMOD.RESULT.OK)
                {
                    Debug.Log(result.ToString());
                    return;
                }
                for (int y = 0; y < eventCount; y++)
                {
                    result = decs[y].getID(out FMOD.GUID id);
                    decs[y].getPath(out string path);

                    if (result != FMOD.RESULT.OK)
                    {
                        Debug.Log(result.ToString());
                        return;
                    }
                   
                    if (path != null)
                    {
                        Debug.Log(id  + " ____ " + path);
                    }
                    else { Debug.Log(id.ToString()); }
                    
                }
                for (int y = 0; y < decs2.Length; y++)
                {
                    decs2[y].getID(out gge);
                    decs2[y].getPath(out ggew);
                    if (gge != null && ggew != null)
                    {
                        Debug.Log(gge+ " ____ " + ggew);

                    }
                }
                for (int y = 0; y < decs3.Length; y++)
                {
                    decs3[y].getID(out gge);
                    decs3[y].getPath(out ggew);
                    if (gge != null && ggew != null)
                    {
                        Debug.Log(gge+ " ____ " + ggew);

                    }
                }
            }
            else
            {
                Banks[i].getPath(out string path);
                Debug.Log($"No events in bank: {path}");
            }
        }
    }
}