Audio Importer: how do you override platform specific settings from code?

Hello everyone, I’m writing a script to set the import parameters for every imported asset in my project, right now changing the default settings is working, but I’m having issues overriding the platform specific settings for the audio assets.
The code I wrote is the following:

using UnityEditor;
using UnityEngine;

internal class AudioImporter : AssetPostprocessor
    void OnPreprocessAudio()
        AudioImporter audioImporter = assetImporter as AudioImporter;
        audioImporter.preloadAudioData = false;
        audioImporter.loadInBackground = false;

        AudioImporterSampleSettings audioImporterSampleSettingsWebGL = new AudioImporterSampleSettings();
        audioImporterSampleSettingsWebGL.compressionFormat = AudioCompressionFormat.AAC;
        audioImporterSampleSettingsWebGL.loadType = AudioClipLoadType.Streaming;
        audioImporterSampleSettingsWebGL.quality = 0.5f;
        bool successfullOverride = audioImporter.SetOverrideSampleSettings("WebGL", audioImporterSampleSettingsWebGL);

The boolean successfullOverride is always false.

I’ve also tried with audioImporter.SetOverrideSampleSettings(BuildTarget.WebGL.ToString(), audioImporterSampleSettingsWebGL);.

Thank you in advance.



audioImporter.SetOverrideSampleSettings (“WebGL”, audioImporterSampleSettingsWebGL); //platform options: “Webplayer”, “Standalone”, “iOS”, “Android”, “WebGL”, “PS4”, “PSP2”, “XBoxOne”, “Samsung TV”

instead of

bool successfullOverride = audioImporter.SetOverrideSampleSettings(“WebGL”, audioImporterSampleSettingsWebGL);

This doesn’t give you a bool value but at least it should override the platform-specific settings.