# Replacing assets, keeping fades etc

**URL:** https://qa.fmod.com/t/replacing-assets-keeping-fades-etc/23650
**Category:** FMOD Studio
**Created:** [November 15, 2025, 9:49pm UTC](https://qa.fmod.com/t/replacing-assets-keeping-fades-etc/23650 "2025-11-15T21:49:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dada\_da](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@dada\_da](https://qa.fmod.com/u/dada_da)
#### Post date: [November 15, 2025, 9:49pm UTC](https://qa.fmod.com/t/replacing-assets-keeping-fades-etc/23650/1 "2025-11-15T21:49:42Z")

</div>

Is there an easy way (script?) to replace assets within an event? I’ll have to create many variants of a complex event where I’ll duplicate the event to create a variant and then replace the underlying assets within the event. Let’s say I have Fiat\_engine\_low.wav used in multiple tracks in the event on a parameter sheet and Fiat\_engine\_low.wav as well and I want to replace them all with Harley\_engine\_low.wav and Harley\_engine\_high.wav without changing each assets fades, position or other settings. Any pointers? Could a script work here (I can’t write scripts unfortunately) Thanks!

---

<div class="post-metadata">

### Author: ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)
#### Post date: [November 24, 2025, 11:17pm UTC](https://qa.fmod.com/t/replacing-assets-keeping-fades-etc/23650/2 "2025-11-24T23:17:19Z")

</div>

Hi,

Sorry for the late response.

> [@dada\_da](#):
>
> Is there an easy way (script?) to replace assets within an event?

Yes, If you actually want every use of `Fiat_engine_low.wav` in the project to become `Harley_engine_low.wav`:

1. In the **Assets browser** , find `Fiat_engine_low.wav`.
2. Right click → **Replace with…**
3. Choose `Harley_engine_low.wav`.
4. Repeat for the “high” file.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/2/226a6c7b2476c74850d14e7170bc3910a18cd68e.png)

Hope this helps!

---

<div class="post-metadata">

### Author: ![dada\_da](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@dada\_da](https://qa.fmod.com/u/dada_da)
#### Post date: [November 25, 2025, 8:49am UTC](https://qa.fmod.com/t/replacing-assets-keeping-fades-etc/23650/3 "2025-11-25T08:49:52Z")

</div>

Thanks, but unfortunately I want to keep using the assets in the original “source event” and only quickly replace the assets to use in the new copy. And I’d rather not do that manually for multiple loops for many vehicles…

---

<div class="post-metadata">

### Author: ![sandeben](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sandeben](https://qa.fmod.com/u/sandeben)
#### Post date: [December 1, 2025, 8:15pm UTC](https://qa.fmod.com/t/replacing-assets-keeping-fades-etc/23650/4 "2025-12-01T20:15:11Z")

</div>

Sorry if you know of this, and it is still quite a manual method, but you can select a single instrument and then drag a new file from the asset browser on top of the waveform at the bottom of the screen to replace the audio in an instrument. Of course, you’ll need to do this for every instance of the instrument, but at least the instrument fades and position will be retained.

---

<div class="post-metadata">

### Author: ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)
#### Post date: [December 3, 2025, 4:07am UTC](https://qa.fmod.com/t/replacing-assets-keeping-fades-etc/23650/5 "2025-12-03T04:07:01Z")

</div>

Apart from manually replacing the assets inside the event, the only other option is to write a custom [Studio script](https://www.fmod.com/docs/2.02/studio/scripting-terminal-reference.html) to automate the process.

Below is an example I made that can demonstrates how you can replace all instances of a specific audio asset inside the currently selected event with another one. This should give you a starting point to build a more complete workflow:

```auto
studio.menu.addMenuItem({
    name: "Tools\\ Swap Assets In Event",

    execute: function () {

        function swapAssets(widget) {

            // Get the current selected event
            var evt = studio.window.browserCurrent();
            if (!evt || !evt.isOfExactType("Event")) {
                console.log("SwapAssets: No event selected.");
                return;
            }

            // Retrieve asset paths from UI
            var oldEdit = widget.findWidget("m_OldAssetText");
            var newEdit = widget.findWidget("m_NewAssetText");
            if (!oldEdit || !newEdit) {
                console.log("SwapAssets: widgets not found.");
                return;
            }

            var oldName = oldEdit.text();
            var newName = newEdit.text();

            if (!oldName || !newName) {
                console.log("SwapAssets: empty old/new name, abort.");
                return;
            }

            // Look up the new AudioFile asset
            var newAsset = studio.project.workspace.masterAssetFolder.getAsset(newName);
            if (!newAsset) {
                console.log("SwapAssets: new asset not found: " + newName);
                return;
            }

            var modules = evt.timeline.modules;
            if (!modules) {
                console.log("SwapAssets: no modules on event timeline.");
                return;
            }

            var replaced = 0;
            
            // Replace all SingleSound modules referencing the old asset
            for (var i = 0; i < modules.length; i++) {
                var inst = modules[i];

                if (!inst.isOfExactType("SingleSound"))
                    continue;

                var file = inst.audioFile;
                if (!file)
                    continue;

                if (file.assetPath === oldName || file.name === oldName) {
                    inst.relationships.audioFile.remove(file);
                    inst.relationships.audioFile.add(newAsset);
                    replaced++;
                }
            }

            console.log("SwapAssets: " + evt.name +
                        " " + oldName + " -> " + newName +
                        " replaced " + replaced + " instance(s).");
        }

        // UI
        studio.ui.showModalDialog({
            windowTitle: "Swap Assets In Event",
            windowWidth: 220,
            windowHeight: 150,
            widgetType: studio.ui.widgetType.Layout,
            layout: studio.ui.layoutType.VBoxLayout,
            items: [
                { widgetType: studio.ui.widgetType.Label,
                  widgetId: "m_OldAssetLabel",
                  text: "Find asset (Asset path):" },

                { widgetType: studio.ui.widgetType.LineEdit,
                  widgetId: "m_OldAssetText",
                  text: "" },

                { widgetType: studio.ui.widgetType.Label,
                  widgetId: "m_NewAssetLabel",
                  text: "Replace with (Asset path):" },

                { widgetType: studio.ui.widgetType.LineEdit,
                  widgetId: "m_NewAssetText",
                  text: "" },

                {
                    widgetType: studio.ui.widgetType.PushButton,
                    text: "Apply",
                    onClicked: function () {
                        swapAssets(this);
                        this.closeDialog();
                    }
                }
            ]
        });
    }
});

```

To use this script:

1. Duplicate the original event to create a working variant.
2. Select the duplicated event in the Event Browser.
3. Run the script from the **Scripts → Tools** menu.
4. Enter the **asset path** of the sound you want to replace and the **asset path** of the new sound.

Please note that this script works on the current selected event and was only tested with single events and a simple timeline setup.

If your events contain nested tracks or if you need to automate multiple events, you will need to extend the script accordingly.

Hope this helps!
