- Home /
How to disable Normalize in AudioImporter
After setting "force to mono" to true on my AudioImporter, I recognized the "Normalize" flag being true in the inspector. How to access the setting so I can turn it off?
I'd also love to know this. It looks as if Unity hasn't made that api public, which doesn't make much sense.
Answer by ink_u0 · Sep 07, 2017 at 03:28 AM
string path = "Assets/Resources/test.wav";
AudioImporter im = AssetImporter.GetAtPath(path) as AudioImporter;
UnityEditor.SerializedObject serializedObject = new UnityEditor.SerializedObject (im);
UnityEditor.SerializedProperty normalize = serializedObject.FindProperty ("m_Normalize");
Debug.LogError ("m_Normalize = " + normalize.boolValue);
This can get value of Normalize toggle. I think set normalize.boolValue = true/false, then SetDirty and AssetDatabase.SaveAssets is also work. I am sorry for my poor english :)
Your answer
Follow this Question
Related Questions
Potential Bug in Audio Compression Settings 1 Answer
Unspecified Error during Audio Import 0 Answers
How to set default sprite import settings? 1 Answer
Creating a Sound setting and saving it. 0 Answers
how do i make audio clips for unity 3d? 2 Answers