- Home /
How do you edit the Normalize toggle field on Audio Clip by script?
I've been digging around for quite a bit but I'm not quite sure how this can be done. I am able to change the following toggle fields by script:
Force To Mono
Load In Background
Preload Audio Data
But I can't figure out how to get the "Normalize" toggle to change via script. Does anyone know how to do this or can anyone point me in the right direction?
Thanks in advance, Tony ~
Answer by FortisVenaliter · May 19, 2016 at 09:52 PM
If I recall correctly, those options affect how the clip is imported into Unity. So, by the time you reference the clip in code, those options aren't available because the clip is already fully imported.
Maybe if you explain a bit more about why you need to access those in code instead of the import inspector, we could offer better advice?
Ah I see. That would make sense. Pretty much what I'm trying to do is, I have an asset I'm working on and a part of the feature is being able to change the audio import settings on each clip all within one window. I got it working for all of the other options except for normalize and sample rate (Hz). But based on what you mentioned above it doesn't seem like I'd be able to really mess with these two options at all.
Now, I don't know this for sure, but if your tool is designed to be run at import time, there may be some way to access the audio importer functionality, and manage this, rather than on the audio clip itself. But I haven't really worked with Unity's import process, so I can't say for sure.
Your answer
