How to suppress compression on custom asset type?

We have a custom audio asset type that stores audio sample data in OGG format within the asset. Is it possible to somehow override the packaging settings on a per asset basis, to prevent the asset being compressed even if the user has enabled ‘Compress Cooked Packages’?

Interesting solution. Different question perhaps? :wink:

oh yeah, sry, I’ll delete this answer, my bad!

Hey kamrann,

So you are attempting to keep your audio uncompressed when packaging?

You can control the compression on a per sound asset basis within the Sound Wave itself. You can also try to use the option within the Packaging settings called ‘Additional Non-Asset Directories to Copy’.

Let me know if you have additional questions.

Thanks,

Hi Andrew.
This isn’t a sound wave, it’s a custom asset type, the internal data of which is already compressed. What I want to avoid is the asset itself then being compressed in the pak file.

From what I can see, it appears each uasset ends up as a file within the pak. From my debugging it seems that when -compressed is used on the cook command line, some files within the pak end up compressed, others don’t. My asset is being compressed and I don’t want it to be, so I was hoping to find out how this is controlled in code.

Did you try and read the option I mentioned?

There is also the option of adding ‘Directors to Never Cook.’

One of these two options should get you to the correct packaging settings so your custom asset is not added to the .pak file.

Thank you,

My custom asset is not a raw file, it is a uasset and needs to be cooked, and added to the pak if the user has chosen to use a pak file. I simply want it to not be compressed.

As I said, from debugging it appears that some assets do avoid being compressed even when ‘Create compressed cooked content’ is checked, I’m trying to find out if/how I can get the same behavior for my custom asset type.

There is no way currently to control this through an in editor setting or preference, however if you modify the WritePakResponseFile function in CopyBuildToStagingDirectory.automation.cs you can choose which files get compressed or not.

This is the only way to currently control what gets compressed/uncompressed when adding to a .pak file and using the packaging settings aforementioned.

Thank you,

I see, so the compression is performed at a later stage by the automation tool it seems. I wonder why it appeared from debugging that some of the contents were compressed and others not then?

Anyway it seems like what I wanted to do isn’t possible without engine changes. Thanks for looking into it Andrew.