FMOD doesn't live update an asset with exactly the same length

I think the FMOD team is aware of this, based on this other topic Live Update Refresh Assets In Play Mode - 2.02.20 - FMOD Studio - FMOD Forums, but for me at least, if I replace an audio asset I would almost always keep the same length, and if the length doesn’t change then FMOD doesn’t recognize the change, so the new audio asset doesn’t get to the Live Game.

There is something intrinsically wrong (for me) in this approach given that the best way of solving this is adding a little text to the asset and then remove it, so FMOD finds out that something changed and then send the new asset to the Live Game. Like in this script that @Leah_FMOD so amazingly did for us:

studio.menu.addMenuItem({
    name: "Force Refresh All Assets",
    keySequence: "Ctrl+R",
    execute: function() {
        console.log("Forcibly refreshing all assets");
        studio.project.workspace.masterAssetFolder.assets.forEach(function(asset) {
		    if (asset.isOfExactType("AudioFile")) {
				//asset.refreshAudio();
				asset.note += " ";
				asset.note = asset.note.trim();
		    }
	    });
    }
});

The other solution that I was having was changing the file name and then getting it back. That’s a little insane, but it also sends the new audio asset to the Live Game.

Wouldn’t it better and just as easy that FMOD checks for “file date” instead of audio length (or “file size” I don’t actually know)? As soon as the audio asset gets updated the “file date” will change, and a lot of problems would be solved.

You’re correct that this is a known issue. I agree that checking for a file modification time and file size changes would be decent options, but neither metric is foolproof - even modification time could have issues if source control is being used. We’re currently considering implementing a file hash which would be serialized to the Studio project’s metadata and used to check for modification, but this is unlikely to be implemented until a major version update to ensure that projects maintain compatibility across minor versions.

For now though, I’m happy to hear that my workaround script is handling it. Feel free to let me know if you run into any issues with it.

Using a file hash could be a great way, but I understand that it will probably break all projects hahaha it is risky.

Your script is working great, more than great actually. You run it once, and by what I read in the code it should happen only once and stop, but afterward all the audio assets that I change get updated to the Live Game, even though I don’t run the script again, at least not in the same session. Which seems perfect for me! Maybe the assets stay dirty forever and FMOD refreshes them, I don’t care why, it is perfect.

And thank you